1

I use Ubuntu 13.10 and Lampp.

When I try to run sudo php artisan job-daemon I get the above message. But when I run php artisan job-daemon it works just fine.

php -m gives me the following:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
mhash
mssql
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sybase_ct
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

which php gives me the following:

/opt/lampp/bin/php

Why do I get the message missing then?

I ran

johnnemo@johnnemo:~$ sudo nano .bashhrc

I added

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

but still no luck....Any ideas..?

$PATH and sudo $PATH :

sudo: /opt/lampp/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: command not found


johnnemo@johnnemo:~$ $PATH
bash: /opt/lampp/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: No such file or directory
John
  • 123
  • 1
  • 7

3 Answers3

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

NOT

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

Basically, the order matters. It now first looks in the /opt/lampp/bin folder to find certain executables and THEN looks at the original paths.

Raza
  • 766
0

OK so the problem is that the PATH is different for the User account and the root account. Try editing the rood bash profile file:

/root/.bashrc

At the bottom add the line

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

To set the path for when sudo is running. Then source the profile:

sudo source /root/.bashrc
0

Look at this link:

mcrypt in Ubuntu 13.10

The PHP modules got moved from the conf.d directory to the mods-available directory, and the mcrypt module got left behind.

  • So it is not a path problem..?But unlikely the other post when I run php-m I can see the mcrypt.. – John Jan 01 '14 at 19:48