PHP $_SERVER error php.ini

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
JustinMs66
Forum Contributor
Posts: 127
Joined: Sun Sep 03, 2006 4:18 pm

PHP $_SERVER error php.ini

Post by JustinMs66 »

ok, i finally expanded my file uploads size using this tutorial:
http://wiki.dreamhost.com/index.php/PHP.ini

so i now, in my /home/username/website.com/cgi-bin/, have my custom php.cgi and php.ini files.

now to enable them for usage i had to put this in the .htaccess file:

Code: Select all

Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi
now ever since i did that, when i try to use:

Code: Select all

$_SERVER['SCRIPT_FILENAME']
instead of displaying "filename.php" like it used to, it now displays "php.cgi"

Help?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

My hunch says that your running php as a CGI binary rather than a built in apache module, it would only make sense for it to show up like that.

Perhaps you should look into using $_SERVER['REQUEST_URI']; or something like that.

It's fairly easy to parse...
Post Reply