简体   繁体   中英

Ubuntu 13.10 and lampp : PHP path issue

I use Ubuntu 13.10 and Lampp. When I try to run :

 sudo php artisan job-daemon

I get : Laravel requires mCrypt PHP extension.

But when I run :

php artisan job-daemon 

it works just fine..

php -m gives me the following:

[PHP Modules]
bcmath
bz2
calendar


.
.
.
.

mcrypt


.
.
.
.
xsl
zip
zlib

[Zend Modules]

which php gives me :

/opt/lampp/bin/php

while sudo which php gives me

/usr/bin/php

I have edited the ~./bashrc as following:

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

I have already asked in Ubuntu forums but still no luck..

The question is why do you use lampp on Ubuntu? Why you don't use the apt package manager?

I think your system has installed PHP over the package manager. Thats why you get another Path with sudo. You have set the Path for your user but not for root (sudo).

So you could try to install the missing package over the package manager with

sudo apt-get install php5-mcrypt

If you need some more packages you can search with the following command

sudo apt-cache search php

then you get all packages with php in the package name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM