Page 1 of 1

error output "no input file specified"

Posted: Wed Feb 05, 2003 10:57 am
by mrhosh
I just changed servers. The old one ran version 4.0.6, and the new one runs 4.something (I was told by cust service). I can't use the <?php phpinfo()?> successfully to find out exactly which version they are running because any script I try to run returns the error message "no input file specified." Is this a problem with my script not being compatible with the server software, or the version of PHP? I'm not sure what server software they are running, either. I'm rather new to php, so I don't really know anything other than what I've read in forums similar to these. Here is a sample of the code I've been using, which worked perfectly on the old server.

<?PHP
/usr/local/bin/php4 #this line was not used on the old server, but without
#it, I was getting "file not found" errors

$filename = $myState.".txt";
if($submit == "yes"){
$fp = fopen($filename,"r");
$old = fread($fp, 800000);
fclose( $fp );
$old = split(",",$old);
$old = implode(",",$old);
$newText = $me.",".$old;
$fp = fopen($filename,"w+");
fwrite($fp, $newText, 800000);
fclose( $fp );
}
$fp = fopen($filename,"r");
$where = fread($fp, 800000);
fclose( $fp );
$where = split(",",$where);
$where = implode(",",$where);

print "&loading=absolutely";
print "&where=".$where;
?>

I don't know what to try...help please! Thanks

Posted: Wed Feb 05, 2003 1:54 pm
by Stoker
a file with just <?php phpinfo(); ?> should work just fine no matter what..

Make sure the tag is not just <? but inclduing the 'php' part, I have noe idea if it is case sensitive, try lowercase just to make sure..

What filename are you using, .php ?

I have seen some that use .phtml, but that is more often used for perl/html (mod_perl).

Posted: Thu Feb 06, 2003 10:06 am
by mrhosh
I ended up figuring it out...
I was using the <?php phpinfo();?> with the .php filename, but it still wasn't reading it. Apparently I needed this line before any code in the file:

#!/usr/local/bin/php4

Everything else works fine now, but I had to change all of my variables from $someVariable to $HTTP_POST_VARS['someVariable'] for them to be read properly. Anyway, thanks very much for the reply.

mrhosh

Posted: Thu Feb 06, 2003 9:05 pm
by Stoker
that means your webserver doesnt have mod_php but uses the cgi executable instead, hopefully the reason for that is running as your own username..

Posted: Fri Feb 07, 2003 2:40 am
by twigletmac
mrhosh wrote:Everything else works fine now, but I had to change all of my variables from $someVariable to $HTTP_POST_VARS['someVariable'] for them to be read properly. Anyway, thanks very much for the reply.
Since they've upgraded your version of PHP you can use the new superglobals instead of the old $HTTP_xxx_VARS arrays, so instead of $HTTP_POST_VARS you can just use $_POST. It definitely cuts down on the typing :) .

For more info:
http://www.php.net/manual/en/language.v ... efined.php

Mac