Restful urls not working with PHP 5.3.29

In order to upgrade OJS to 2.4.8.1 version I had to choose a PHP 5.3.x version (5.3.29 in my case).

I uploaded a fresh installation of OJS 2.4.8.1 and then I updated:

  • config.inc.php (e /.htaccess)
  • /public
  • /files

and other customized files.

I got “No input file specified” error.
So I changed my PHP.ini option from “default” to “cgi.fix_pathinfo”.

Now I can see my OJS website but only if I set “restful_urls = Off”.
If I set it to ON I get a “No input file specified.” message.

My OJS in not in the root directory but in a subfolder (/ojs).

My .htaccess is the same:

DirectoryIndex index.php

# Turn mod_rewrite on
RewriteEngine On

RewriteBase /ammentu
#RewriteRule ^admin(.*)$ index.php/index/admin$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

In config.inc.php I have:

base_url = "http://www.MYSITE.it/ojs"

base_url[index] = http://www..MYSITE.it/ojs/index.php/index/
base_url[myJournal] = http://www..MYSITE.it/ojs/index.php/MyIssue/

restful_urls = Off

I read this old thread https://pkp.sfu.ca/support/forum/viewtopic.php?t=11576, a case similar to mine. I put this line

$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];

at the start of the index.php page but it not works.

My index page now is http://www.MYSITE.it/ojs/index.php/MyIssue

Any suggestions are welcome beacause I’m STUCK. Thanks in advance.

What server are you running under? Please detail the OS and webserver type and version.

Web server Apache 2.4, hosting Linux.

This sounds largely like a PHP/Apache configuration issue rather than an OJS question, so you may find better results with a forum such as StackExchange.

Aside from your PHP version being pretty old, I’m wondering about the lack of a trailing slash on the RewriteBase directive.

Additionally, note that for Apache 2.4 you may need %{DOCUMENT_ROOT}%{REQUEST_URI} instead of %{REQUEST_FILENAME}, which was the default in Apache 2.2.