3

I have been trying to search about this problem a few hours but none of the solutions seem to work in my case.

I have installed joomla in my nginx server on raspbian for testing purposes. The directory is in /var/www/joomla.

The site works if I change the root directory from /etc/nginx/sites-available to /var/www/joomla, but if I want my joomla site accessed from http://www.example.com/joomla, it won't work. I can get to the joomla homepage, but if I click some link from the homepage (for example I have a contact form which address is http://www.example.com/joomla/index.php/contact) I get "No input file specified error".

Here is my config from /etc/nginx/sites-available/site:

server {
     listen 80;
     root /var/www;
     index index.php index.html index.htm;

     location / {
          try_files $uri $uri/ /index.php?q=$request_uri;
     }

     location ~ \.php$ {
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
     }
     }

I read this error may have something to do with fastcgi_param SCRIPT_FILENAME, but I didn't figure out what I should edit and from where.

Thank you!

2
  • Isn't the problem that you are sending requests to /index.php when this file is actually located at /joomla/index.php ? Commented Dec 3, 2014 at 11:28
  • Thank you Joe Niland! That was the reason and now it is working. Commented Dec 3, 2014 at 17:31

2 Answers 2

3

Yes! I got it working. Thanks to Joe Niland who told the solution.

I actually tried it once but I may have missed the '/' before the joomla/index.php....

The working /etc/nginx/sites-available/site configuration is now:

server {
 listen 80;
 root /var/www;
 index index.php index.html index.htm;

 location / {
      try_files $uri $uri/ /joomla/index.php?q=$request_uri;
 }

 location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
 }
 }
Sign up to request clarification or add additional context in comments.

Comments

0

Look below for config setting

server {
     listen 80;
     root /var/www;
     index index.php index.html index.htm;

     location / {
          try_files $uri $uri/ /index.php?q=$request_uri$args;
     }

     location ~ \.php$ {
            root /var/www;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include fastcgi_params;
     }
     }

1 Comment

Can you add some more information around why you think this answer might solve the askers problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.