I'm trying to follow the instructions here: http://www.php.net/manual/en/features.commandline.usage.php
- I created a file named "vardump"
Added this code to the file:
#!/usr/bin/php <?php var_dump($argv); ?>
- did
chmod +x vardump
but 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