Ubuntu: How can one call programs that are not “rooted” in the operating system


I am currently trying to install a php extension on my computer. I am in the process of developing a new site and I am using LAMPP. I used PECL to install the syck YAML extension so that I can parse YAML to a PHP array in a file that will run daily with cronjobs.

In the process of trying to install it, I broke LAMPP and had to re-install it, but I got the extension installed. Here's the kicker! The extension was installed on PHP5 that is called by the terminal.

If I:

# php ./politicianupdate.php  

It runs as it should, but it is not using the php installation inside of lampp, which is a problem because the php being ran from the terminal is not linked up to my databases, which I need to keep the data current.

Two things I need to figure out: how I can call a .php file from the terminal using the php installation in lampp, and the other thing I need to know is how can I point a PECL/PEAR installation at the installation of php in lampp?

The output of whereis php is:

php: /usr/bin/php /usr/bin/X11/php /usr/share/php /opt/lampp/bin/php /usr/share/man/man1/php.1.gz  


Then I suggest you to use:

/opt/lampp/bin/php ./politicianupdate.php  

If is ok, then check with ls -l /usr/bin/php if is a symbolic link. If yes, and if you would like, remove it then create a new one to /opt/lampp/bin/php:

ln -sf /opt/lampp/bin/php /usr/bin/php  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »