Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
June 30, 2008 - Submit Your Site for the July 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 25, 2008, 11:59:27 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: php exec, passthru - 404 - No input file specified.  (Read 700 times)
zonathen
Newbie
*
Offline Offline

Posts: 3


« on: December 12, 2007, 10:10:22 PM »

Hello, I am trying to launch a php script using exec or passthru and I get a 404, no input file specified when I use the exact same script on other hosting and it is fine.

exec("/usr/bin/php /home/domain/public_html/script.php")

script.php exists, it's chmod 755, the same command entered in the command line works fine but when ran via the browser it gives the "No input file specified"

Is there some sort of voodoo necessary to make this work on your servers?

Thanks
Logged
perestrelka
Administrator
Jedi
*****
Offline Offline

Posts: 980



« Reply #1 on: December 14, 2007, 10:43:12 PM »

Hi,

Did you try to modify the php script you try to exec to have the !# construction to cause the script to load php and then just use "exec(/path/to/script.php)" as the execute permissions are already set as per your words.

An example of the !# is shown below:

#!/path/to/php
<?php
        // your php code
?>

Please give it a test and let me know about the result.
Logged

Kind Regards,
Vlad Artamonov
zonathen
Newbie
*
Offline Offline

Posts: 3


« Reply #2 on: December 16, 2007, 09:17:20 PM »

Nope, same result...  I didn't realize you could use that !# directive in a php file, I thought that was for perl or shell scripting only.  Just to be sure we are on the same page, I am executing the php script from another php script, not perl or shell script.  Any other ideas?  I swear it works from the command line when I echo the command string and run it manually.  Has to be a php related access restriction or something.  Do I need a .htaccess with a basedir or any other magic?  I'll play around with that in the meantime.

Also, I have to explicitly write php debug statements to an error log in the web folder because I can't find the default php error log anywhere on the system.  And when I specify an absolute path to the error log in php.ini and chmod it like I've found in other posts it simply ignores it.  And yes, I am sure it's the right php.ini because it's what shows up in phpinfo.  log_errors is on and i do the standard reboot of apache after every change to php.ini.

Appreciate the help!
« Last Edit: December 16, 2007, 09:19:14 PM by zonathen » Logged
zonathen
Newbie
*
Offline Offline

Posts: 3


« Reply #3 on: December 16, 2007, 09:42:52 PM »

Okay, it was a pathing issue to php per this other post.  I looked at this post before but didn't notice the path difference to /usr/local/bin/php.  Now I am running into other probs.  Any help on the error log issue?

http://www.lunarforums.com/lunarpages_php_mysql/php_cron_no_input_file_specified-t44059.0.html

Thanks again!
Logged
perestrelka
Administrator
Jedi
*****
Offline Offline

Posts: 980



« Reply #4 on: December 18, 2007, 11:58:00 PM »

Hi,

PHP error logs also maybe recorded in the apache error log. As for how get separate php error log, can you please specify how PHP is configured in your Apache? Do you run php as mod_php or use suPHP?

Logged

Kind Regards,
Vlad Artamonov
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM