Custom server, issues loading home.php

Known bugs reported by PacsOne users
Post Reply
jking0826
Posts:9
Joined:Mon Jun 22, 2015 1:07 am
Custom server, issues loading home.php

Post by jking0826 » Thu Jun 25, 2015 2:58 pm

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?

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Re: Custom server, issues loading home.php

Post by pacsone » Thu Jun 25, 2015 10:58 pm

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.

jking0826
Posts:9
Joined:Mon Jun 22, 2015 1:07 am

Re: Custom server, issues loading home.php

Post by jking0826 » Fri Jun 26, 2015 6:34 pm

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
loginerror.PNG (80.8KiB)Viewed 11335 times

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Re: Custom server, issues loading home.php

Post by pacsone » Fri Jun 26, 2015 11:11 pm

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:

Code: Select all

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

jking0826
Posts:9
Joined:Mon Jun 22, 2015 1:07 am

Re: Custom server, issues loading home.php

Post by jking0826 » Sat Jun 27, 2015 1:56 am

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

jking0826
Posts:9
Joined:Mon Jun 22, 2015 1:07 am

Re: Custom server, issues loading home.php

Post by jking0826 » Sat Jun 27, 2015 2:20 am

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
Attachments
custom_php_vars.PNG
custom_php_vars.PNG (42.17KiB)Viewed 11331 times
apache_php_vars.PNG
apache_php_vars.PNG (63.67KiB)Viewed 11331 times

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Re: Custom server, issues loading home.php

Post by pacsone » Sat Jun 27, 2015 10:29 pm

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.

jking0826
Posts:9
Joined:Mon Jun 22, 2015 1:07 am

Re: Custom server, issues loading home.php

Post by jking0826 » Sun Jun 28, 2015 3:54 pm

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
netweb.PNG (41.55KiB)Viewed 11322 times

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Re: Custom server, issues loading home.php

Post by pacsone » Sun Jun 28, 2015 10:15 pm

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.

Post Reply