Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Nginx + PHP (PHPMYADMIN)
PostPosted: Sun Jan 23, 2011 3:54 pm 
Offline
Senior Newbie

Joined: Sun Jan 23, 2011 2:33 pm
Posts: 5
I'm attempting to get phpmyadmin working alongside nginx. I used the below guide on 'Installing nginx from the Source Distribution':

http://library.linode.com/web-servers/n ... an-5-lenny

As I only intend to use one website, with a single IP, I have my nginx path as /opt/nginx and my site files located in /opt/nginx/html on the VPS.

I have phpmyadmin installed. I placed a link to /usr/share/phpmyadmin in /opt/nginx/html.

Here is my [broken] site as it stands currently (html files work fine, but not php):

http://****.net/noname.php (test php file)

http://****.net/phpmyadmin (link to /usr/share/phpmyadmin)

My nginx.conf:

Code:
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /opt/nginx/html;
            index  index.html index.htm index.php;
        }

        #error_page  404              /404.html;

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

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           /opt/nginx/html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    #    ssl_prefer_server_ciphers   on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}


Would greatly appreciate some assistance from you fine folks.

Thank you.


Last edited by Goodstine on Sun Jan 23, 2011 5:57 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Sun Jan 23, 2011 4:11 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
That "No input file specified" error usually means that you're setting the wrong value to the SCRIPT_FILENAME parameter.

Code:
fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name; 

Is there actually a directory named /scripts where you're keeping all your PHP files?

If not, change to:

Code:
fastcgi_param  SCRIPT_FILENAME  /opt/nginx/html$fastcgi_script_name; 

or wherever your PHP files are. (It's not relative to the document root.)


Top
   
 Post subject:
PostPosted: Sun Jan 23, 2011 5:56 pm 
Offline
Senior Newbie

Joined: Sun Jan 23, 2011 2:33 pm
Posts: 5
Worked. :)

I somehow overlooked that.

Thank you.


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


Who is online

Users browsing this forum: No registered users and 0 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