Web Development and stuff…

PHP CLI bad interpreter: Permission denied

without comments

This question came up on the php.general list today. And i have seen it before when writing an shell script in PHP.

#!/usr/local/bin/php
passthru("printenv");

If you are sure the PHP executable can be found in that location. And the file is executable. But it still returns this error:

/usr/local/bin/php: bad interpreter: Permission denied

Big change the file you are trying to execute is on a filesystem with the noexec flag set.
To fix this either set the exec flag for the filesystem or move the script to a place where it can be executed.

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Written by Thijs Lensselink

March 13th, 2009 at 3:59 pm

Posted in Code, PHP

Tagged with , ,

Leave a Reply