figo2476 Posted May 12, 2008 Share Posted May 12, 2008 Hi: Basically, run.php will do some stuff for PDF & it will run shell command lines by shell_exec() e.g. shell_exec("/var/www/vhosts/site.com/httpdocs/applications/home/utils/linux/pdf2image") I run: run.php in command line, then sh complains error: sh: /var/www/vhosts/site.com/httpdocs/applications/home/utils/linux/pdf2image: No such file or directory sh: /var/www/vhosts/site.com/httpdocs/applications/home/utils/extract/pdf2image: No such file or directory comments: It happens that I can run ./pdf2image inside the correct directory in shell. If I specify the full path in shell like /var/www/vhosts/site.com/httpdocs/applications/home/utils/linux/pdf2image, it will complain No such file or directory any hint? Quote Link to comment Share on other sites More sharing options...
btherl Posted May 12, 2008 Share Posted May 12, 2008 What do these shell commands show: ls -l /var/www/vhosts/site.com/httpdocs/applications/home/utils/linux/pdf2image ls -l /var/www/vhosts/site.com/httpdocs/applications/home/utils/extract/pdf2image Quote Link to comment Share on other sites More sharing options...
DarkWater Posted May 12, 2008 Share Posted May 12, 2008 I'd do: ls -al /var/www/vhosts/site.com/httpdocs/applications/home/utils/linux ls -al /var/www/vhosts/site.com/httpdocs/applications/home/utils/extract =P Quote Link to comment Share on other sites More sharing options...
figo2476 Posted May 12, 2008 Author Share Posted May 12, 2008 Solved. Because one part of the file path will be changed dynamically, I need to hard code it. Thank for pointing out the idea. Quote Link to comment Share on other sites More sharing options...
trq Posted May 12, 2008 Share Posted May 12, 2008 The error is actually caused by you trying to execute a php script using sh. You need to put a shbang in your php file. #!/usr/bin/php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.