You are viewing the PKP Support Forum | PKP Home Wiki

404 errors after PHP upgrade

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

404 errors after PHP upgrade

Postby comthelp » Wed May 02, 2012 3:42 am

After a recent PHP upgrade from 5.2.9 to 5.3.6 on a Debian x64 installation, our OJS 2.3.6 instance started generating 404 error for all but the top-level 'index.php' page. It may not be PHP's fault, I'm confused by how the pages are called. I have now patched in 2.3.7 and upgraded the database (MySQL on the same host) with no difference to the fault.

We have OJS configured as a virtual host in Apache 2.2 on its own DNS entry, i.e. 'http://mysite.mydomain.com/'. Links across the top contain URLs like 'http://mysite.mydomain.com/index.php/index/about' for About and 'http://mysite.mydomain.com/index.php/index/user/register' for Register. I can see from the structure of OJS the About link should refer to 'OJSROOT/pages/about/index.php' but cannot find a 'OJSROOT/pages/user/register/' folder.

How is this redirection accomplished? Apache does not have any mod_rewrite rules for this virtual host and there are no .htaccess files in the OJSROOT folder apart from two buried deep in the 'lib' folder.

I don't recall how the links worked before so now I'm not sure what part of the system is broken and would appreciate some advice.
Posts: 2
Joined: Wed May 02, 2012 2:21 am

Re: 404 errors after PHP upgrade

Postby asmecher » Wed May 02, 2012 8:45 am

Hi comthelp,

Generally speaking, anything after the /index.php should be captured by PHP and passed as a server parameter (PATH_INFO) to the index.php script. Depending on your new PHP configuration that server parameter may not be working correctly any more. For systems that don't support PATH_INFO, there is a config.inc.php option (disable_path_info) that generates URLs in a different way that doesn't cause this to happen -- but you'll notice that enabling this changes all your URLs, which is probably not desirable as it'll break all previous links into your OJS installation. I'd suggest investigating your new PHP configuration to see why the PATH_INFO variable is not working.

You can check this without involving OJS by creating a simple test script:
Code: Select all
<?php phpinfo(); ?>
If you put this somewhere on your server, it'll generate a lot of debug output describing your PHP environment. If you add path elements to the end of the URL (e.g. http://.../test.php/some/path/info/parameters/here) you'll see whether your PHP environment supports this kind of parameter or not.

Alec Smecher
Public Knowledge Project Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: 404 errors after PHP upgrade

Postby comthelp » Wed May 02, 2012 9:09 am

Thanks for the help Alec. I've added 'AcceptPathInfo On' to the Apache2 virtual host and our OJS is now up and running again :D

I did read the config file comments regarding PATH_INFO but didn't realise that was the cause. Not sure what Apache2 has changed (must have upgraded that atsame time as PHP) but I will remember that for future reference.
Posts: 2
Joined: Wed May 02, 2012 2:21 am

Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 1 guest