OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Install problem nginx + php-fpm + ojs 2.4.0

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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Install problem nginx + php-fpm + ojs 2.4.0

Postby pablox » Sun Sep 30, 2012 9:44 am

Hi! I ran nginx on my linode and I was trying to make OJS work here. After reading the minimum reqs I thought it could work (well, it says nginx isn't supported; but hey, even wordpress says doesn't run with nginx).

After downloading it when I try to access the url ojs.example.com I found that I get an empty white page and something that looks like some infinite loop this webpage (it keeps like "reloading it"):

http://ojs.example.com/index.php/index/install

That "index.php" in the middle of the uri looks weird, but on my wordpress websites pretty urls and query urls works fine (I mention this because I recall having a similar issue a year ago, but i resolved it).

Afaik or what I understood from the user guide, to see the install screen it's not needed to touch the config.inc.php, so it's "as it came".

Any help would be very welcome :)
pablox
 
Posts: 5
Joined: Sun Sep 30, 2012 9:35 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby JasonNugent » Sun Sep 30, 2012 2:11 pm

Hi pablox,

White pages can be caused by a lot of different things. Right out of the box, they are usually permission errors on the cache/ directory. You do need to have a copy of config.inc.php present, but it does not need to be writeable or modified for the initial page load.

Are you seeing any errors in the Nginx log file? The 'index.php' in the URL is fine, and is how OJS URLs are supposed to look.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 885
Joined: Tue Jan 10, 2006 6:20 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby pablox » Sun Sep 30, 2012 4:41 pm

The config.inc.php is present, with my usual permissions. I'm running ojs in its own php pool, so php-fpm runs as the owner of those files.

Code: Select all
drwxr-sr-x  6 rev_anacem www-data 4.0K Sep  1 01:03 cache/

-rw-r--r--  1 rev_anacem www-data  14K Sep  1 01:03 config.inc.php


If I call an specific php file, let's say info.php, it's loaded without issues, so php is working too.

The weird thing, is as soon as I enter the urls ojs.example.com there's some redirection to ojs.example.com/index.php/index/install and enters an infinite loop. It looks like I'm pressing the reload button all the time.

The error log doesn't show nothing interesting =/.

The access log:

Code: Select all
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:30 +0000] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:31 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:32 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:32 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:34 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:35 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:35 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:36 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:37 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:38 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:39 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:40 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:40 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:41 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
xxx.xx.xx.xxx - - [30/Sep/2012:23:34:42 +0000] "GET /index.php/index/install HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"


That's only when I enter one time -as I said- it reloads all the time, until I "stop" the webpage from loading.
pablox
 
Posts: 5
Joined: Sun Sep 30, 2012 9:35 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby JasonNugent » Mon Oct 01, 2012 7:21 am

I think you're hitting the same reason why Wordpress doesn't work with Nnginx -- there are PHP variables that are not being set correctly by nginx when run from what amounts to a command line mode. OJS is looping because it's not seeing what it needs and redirecting to find it. If memory serves, FastCGI does not populate the _SERVER array with path information. You could probably dig through some of the OJS code and see if you can get it working with $_ENV["ORIG_PATH_INFO"] instead.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 885
Joined: Tue Jan 10, 2006 6:20 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby JasonNugent » Mon Oct 01, 2012 7:29 am

Here is one other thing you can try. Edit your config.inc.php file and set disable_path_info to On.

Code: Select all
disable_path_info = On


Regards,
Jason
JasonNugent
Site Admin
 
Posts: 885
Joined: Tue Jan 10, 2006 6:20 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby pablox » Mon Oct 01, 2012 1:06 pm

JasonNugent wrote:I think you're hitting the same reason why Wordpress doesn't work with Nnginx -- there are PHP variables that are not being set correctly by nginx when run from what amounts to a command line mode. OJS is looping because it's not seeing what it needs and redirecting to find it. If memory serves, FastCGI does not populate the _SERVER array with path information. You could probably dig through some of the OJS code and see if you can get it working with $_ENV["ORIG_PATH_INFO"] instead.


Well, actually wordpress works fine.... with pretty urls and everything =).

JasonNugent wrote:Here is one other thing you can try. Edit your config.inc.php file and set disable_path_info to On.

Code: Select all
disable_path_info = On



Yay! :D. It worked. The only problem is the urls turned to "query urls" instead pretty urls =(. I guess that's enough for now, but I'm kind of interested in find which is the issue.

I've searched trough the code and found a lot of $_SERVER arrays. Do you suggest to try changing every one of them?
pablox
 
Posts: 5
Joined: Sun Sep 30, 2012 9:35 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby JasonNugent » Mon Oct 01, 2012 1:42 pm

No, most of those _SERVER variables are probably fine. If turning off path_info in config.inc.php solved the problem, you're probably good for the time being. This problem also exists in lighttpd (and probably anything that does PHP as a CLI).

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 885
Joined: Tue Jan 10, 2006 6:20 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby pablox » Mon Oct 01, 2012 4:29 pm

Yes, but there's any plan to make it compatible with lighttpd / nginx? Pretty urls are best for seo so yes... I can go meanwhile with this, but still seems like a workaround for me :)
pablox
 
Posts: 5
Joined: Sun Sep 30, 2012 9:35 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby JasonNugent » Tue Oct 02, 2012 6:23 am

You can do a lot of that work yourself, with mod_rewrite or the nginx/lighttpd equivalent, which is how Wordpress does it (see their documentation on Permalinks).
JasonNugent
Site Admin
 
Posts: 885
Joined: Tue Jan 10, 2006 6:20 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby pablox » Tue Oct 02, 2012 12:20 pm

Thanks for your time. I'll check that, but I guess it won't be so soon, we can live with query urls (I hope xD).

I'm still curious though... making compatible with nginx is something that the development team is planning to do?
pablox
 
Posts: 5
Joined: Sun Sep 30, 2012 9:35 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby JasonNugent » Wed Oct 03, 2012 9:24 am

pablox wrote:I'm still curious though... making compatible with nginx is something that the development team is planning to do?


It works now. The problem is that Nginx essentially runs PHP via command line, which means that the environment is different. It will work just fine with the path_info directive. If you want pretty URLs, you can probably get those pretty easily with some investigation on your part. We'd love to support every OS/System configuration but we have limited developer resources and have to prioritize accordingly.

If you get something working for you, feel free to contribute :)

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 885
Joined: Tue Jan 10, 2006 6:20 am

Re: Install problem nginx + php-fpm + ojs 2.4.0

Postby asmecher » Wed Oct 03, 2012 10:02 am

Hi all,

For a quick way of testing this configuration that won't mean delving deeply into OJS routing/request code in the process: create a phpinfo script, e.g. called test.php, with the following contents.
Code: Select all
<?php phpinfo(); ?>
Point your browser to it to ensure that it loads.

Now try tacking a PATH_INFO component on the end of the URL. If you were requesting http://myserver.com/test.php, try http://myserver.com/test.php/one/two/three.

If the server can still load the page OK, then you just need to double-check that the PATH_INFO server variable contains the /one/two/three part of the URL.

If the server can't load the page, then you'll need to tinker with your PHP/web server integration.

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


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 12 guests

cron