Php won't work. (Noob Level)

December 28, 2013 1.7k views
Hi, I tried 4 different OS but php didn't work in any. Now I'm on CentOS 6.5 x64 with nginx mysql & php If i go to "info.php" i got simply "nginx error!" What shoould I do? Thanks.
3 Answers
That's my default.conf ;

server {
listen 80;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;

error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;

# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;

# proxy the PHP scripts to Apache listening on
#location ~ \.php$ {
# proxy_pass;

# pass the PHP scripts to FastCGI server listening on
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
What exact error do you get?
On Ubuntu, you have to create the info.php file, manually. See How To Install Linux, nginx, MySQL, PHP (LEMP) stack on Ubuntu 12.04.
by Etel Sverdlov
LEMP stack is a group of open source software to get web servers up and running. The acronym stands for Linux, nginx (pronounced Engine x), MySQL, and PHP. This tutorial explains how to install the required repos to download nginx and php-fpm, how to install MySQL, how to install nginx, how to install php-fpm, how to configure php and nginx, and how to create a php info page. This tutorial is written for Ubuntu 12.04.
Have another answer? Share your knowledge.