Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Create shortcut for PHP

General Tech Bugs & Fixes

Max. 2000 characters
Replies

usr_profile.png

User

( 5 months ago )

I have XAMPP installed and my PHP is:

/opt/lampp/bin/php-5.3.8

Every time I need to execute a PHP file I need to do this:

/opt/lampp/bin/php-5.3.8 testando.php

Is there another way to execute it besides using symbolic link?

I did this on /etc/init.d/:

sudo ln -s /opt/lampp/bin/php-5.3.8 php

Why when I need to run PHP I have to do this ./php instead of just php?

And is there a way to do this without the ./? Like it was installed via apt-get?

usr_profile.png

User

( 5 months ago )

php wasn't a boot script , you should never put that in /etc/init.d

Normally you should have a symbol link named php in /opt/lampp/bin/ , which is linked to /opt/lampp/bin/php-5.3.8

(If not , do ln -s /opt/lampp/bin/php-5.3.8 /opt/lampp/bin/php to make this work)

And in your ~/.bashrc , add more path to $PATH:

export PATH=$PATH:/opt/lampp/bin/

And you execute your script like this , on any directory:

php XX.php

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif