Custom server, issues loading home.php
I have a custom built server app that gives the following message when trying to load home.php:
Status: 302 Moved Temporarily X-Powered-By: PHP/5.5.12 Set-Cookie: PHPSESSID=obbsu55gc1cg95ikvv513bf471; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: login.php?message=Welcome+to+PacsOne+Server Content-type: text/html
A Google search indicates this is a redirection issue. I believe I have redirection turned off with the following code in php.ini:
cgi.force_redirect = 0
Any suggestions?
Status: 302 Moved Temporarily X-Powered-By: PHP/5.5.12 Set-Cookie: PHPSESSID=obbsu55gc1cg95ikvv513bf471; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: login.php?message=Welcome+to+PacsOne+Server Content-type: text/html
A Google search indicates this is a redirection issue. I believe I have redirection turned off with the following code in php.ini:
cgi.force_redirect = 0
Any suggestions?
Re: Custom server, issues loading home.php
This is a standard PHP redirect as the Home page requires user authentication thus the redirect to the Login.php page, but your web server does not appear to be following the redirect to the Login page properly, so you should check the technical support for your custom-built web server, and make sure it can follow the HTTP redirect properly.
Re: Custom server, issues loading home.php
Thanks. That makes sense. So, when I try to load login.php directly I get the attached image. Can you help me understand this error?
- Attachments
-
- loginerror.PNG (80.8KiB)Viewed 11335 times
Re: Custom server, issues loading home.php
Two issues:
1. The $_SERVER['SERVER_NAME'] variable is one of the superblobals pre-defined in PHP version 4.1.0 or later releases, so if your PHP claims that variable is un-defined, then it appears there's some problem with your version of PHP.
2. The message about the un-defined $_SERVER['SERVER_NAME'] variable is actually a PHP notice, which should NOT be displayed for production environments. So you should check your PHP.INI configuration file, and modify the following line:
1. The $_SERVER['SERVER_NAME'] variable is one of the superblobals pre-defined in PHP version 4.1.0 or later releases, so if your PHP claims that variable is un-defined, then it appears there's some problem with your version of PHP.
2. The message about the un-defined $_SERVER['SERVER_NAME'] variable is actually a PHP notice, which should NOT be displayed for production environments. So you should check your PHP.INI configuration file, and modify the following line:
Code: Select all
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
Re: Custom server, issues loading home.php
Thanks for the info. According to hello.php I'm running PHP version 5.5.12. Where can I check to see if this superglobal is set properly or exists at all?
Also, what about the message in red that says I'm not authorized to use login.php. Can login.php be called directly or should it always be called from home.php?
Jeff
Also, what about the message in red that says I'm not authorized to use login.php. Can login.php be called directly or should it always be called from home.php?
Jeff
Re: Custom server, issues loading home.php
OK, I found where the php variables are listed in the output of hello.php. I have attached the image from running with my custom server (custom_php_vars.png) and with Apache (apache_php_vars.png). The SERVER_NAME is indeed missing when running my custom server. It is present when running under Apache.
One thing I have not mentioned is that my custom server directs all php pages through PHP-CGI.exe. I have the server set to use the one in the version 5.5.12 installation folder. Knowing this, can you offer any other suggestions?
Is there a way to manually set these superglobals?
Thanks,
Jeff
One thing I have not mentioned is that my custom server directs all php pages through PHP-CGI.exe. I have the server set to use the one in the version 5.5.12 installation folder. Knowing this, can you offer any other suggestions?
Is there a way to manually set these superglobals?
Thanks,
Jeff
- Attachments
-
- custom_php_vars.PNG (42.17KiB)Viewed 11331 times
-
- apache_php_vars.PNG (63.67KiB)Viewed 11331 times
Re: Custom server, issues loading home.php
You'd need to consult with the technical support for your custom web server, since there's nothing we can do from our end if the custom web server does not provide some of the pre-defined variables via PHP.
Re: Custom server, issues loading home.php
Thanks. I looked at the source code for my custom web server. It had a few lines commented out that deal with the SERVER_NAME and REDIRECT_STATUS. I uncommented these but it did not help. There was some indication that SERVER_NAME is not used or required when using php-cge.exe. Is this true? You may see the code in the attached image.
- Attachments
-
- netweb.PNG (41.55KiB)Viewed 11322 times
Re: Custom server, issues loading home.php
We are not familiar with this custom web server software so we are not the best source for help with this issue. You should check with the technical support for this custom web server software, or post a message to the users' forum for this web server software and inquire about why the SERVER_NAME variable was not available.