I'm trying to follow the instructions here: http://www.php.net/manual/en/features.commandline.usage.php
Added this code to the file:
#!/usr/bin/php
<?php
var_dump($argv);
?>
chmod +x vardumpbut I'm getting a permission denied error when executing the file:
shiki@Etna:~/projects/tests$ ./vardump
bash: ./vardump: Permission denied
shiki@Etna:~/projects/tests$ sudo ./vardump
sudo: unable to execute ./vardump: Permission denied
What could be the problem? I'm running Ubuntu 10.04.
Executing it like this works though:
shiki@Etna:~/projects/tests$ php vardump
array(1) {
[0]=>
string(7) "vardump"
}
Here are the file permissions:
shiki@Etna:~/projects/tests$ ls -l
-rwxrwxrwx 1 root root 41 2010-06-23 07:25 vardump
shiki@Etna:~/projects/tests$ ls -l /usr/bin/php
lrwxrwxrwx 1 root root 21 2010-06-02 15:34 /usr/bin/php -> /etc/alternatives/php
Solved it. Based on all your answers, I suspected the problem is not in php at all. I'm running the script on a NTFS mount so I tried to move it to the root mount and it worked there. So I added exec to /etc/fstab and it worked.
UUID=0B02861D7B0D6A31 /media/Data ntfs-3g defaults,users,exec,locale=en_PH.UTF-8 0 0
This answer also gave me the clue for it. Thanks a lot for all your help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With