Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Feb 05, 2015 12:04 pm 
Offline
Newbie

Joined: Thu Feb 05, 2015 11:50 am
Posts: 2
Sorry I'm missing something obvious, but I've thoroughly followed through this guide on setting up LEMP stack, but when I do open any of the pages it just initiates download of .php file I would normally access on the page, and the file itself is renamed to a string of 8 random alphanumeric symbols, with extension stripped.


Top
   
PostPosted: Thu Feb 05, 2015 5:10 pm 
Offline
Linode Staff
User avatar

Joined: Thu Sep 06, 2012 2:22 pm
Posts: 26
Location: New Jersey - Where the weak are killed and eaten.
It sounds to me like PHP isn't being executed on the server. Start by confirming that you installed the PHP handler, and configured Nginx to utilize it.


Top
   
PostPosted: Thu Feb 05, 2015 6:07 pm 
Offline
Newbie

Joined: Thu Feb 05, 2015 11:50 am
Posts: 2
alexfornuto wrote:
It sounds to me like PHP isn't being executed on the server. Start by confirming that you installed the PHP handler, and configured Nginx to utilize it.

Yes, those both are done, I double checked it right now.

After reading a bit more, I added following code
Code:
location ~ \.php$ {
    try_files $uri =404;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/test.example.com/public_html$fastcgi_script_name;
    }

to my /etc/nginx/conf.d/test.example.com.conf and now I get error 404 when I attempt to load any page.

Edit: Resolved with following /etc/nginx/conf.d/test.example.com.conf
Code:
server {
listen  80;
listen 443 default ssl;

server_name test.example.com;
root  /var/www/test.example.com/public_html;

access_log /var/www/test.example.com/logs/access.log;
error_log /var/www/test.example.com/logs/error.log;

location / {
    try_files $uri $uri/ /index.php;
    }

location ~ \.php$ {
    try_files $uri =404;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group