error output "no input file specified"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mrhosh
Forum Newbie
Posts: 2
Joined: Wed Feb 05, 2003 10:57 am

error output "no input file specified"

Post 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
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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).
mrhosh
Forum Newbie
Posts: 2
Joined: Wed Feb 05, 2003 10:57 am

Post 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
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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..
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply