Results 1 to 6 of 6

Thread: How to Install Nginx with PHP5 on Fedora 12

  1. #1
    Join Date
    Jul 2009
    Posts
    87

    How to Install Nginx with PHP5 on Fedora 12

    Hi everybody,

    I want to use Nginx that is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. I want to install Nginx on a Fedora 12 server with PHP5 support and MySQL . Please suggest. Thanks in advance.
    http://forums.techarena.in/guides-tutorials/1135890.htm

  2. #2
    Join Date
    Nov 2005
    Posts
    3,026

    How to Install Nginx with PHP5 on Fedora 12

    First you need to install MySQL 5 by this command
    Code:
    yum install mysql mysql-server
    Then make the system startup links for MySQL and start the MySQL server by command :
    Code:
    chkconfig --levels 235 mysqld on
    /etc/init.d/mysqld start
    Now you need to check that networking is enabled or not by this command:
    Code:
    netstat -tap | grep mysql
    and restart your MySQL server. Best of luck.

  3. #3
    Join Date
    May 2008
    Posts
    2,680

    How to Install Nginx with PHP5 on Fedora 12

    Actually the Nginx is available as a package for Fedora 12 which you can install by this command:
    Code:
    yum install nginx
    Then you need to make the system startup links for nginx and start it with this command:
    Code:
    chkconfig --levels 235 nginx on
    /etc/init.d/nginx start
    Then type in your web server's IP address otherwise hostname into a browser. Best of luck.

  4. #4
    Join Date
    Nov 2005
    Posts
    3,026

    How to Install Nginx with PHP5 on Fedora 12

    You can make PHP5 work in nginx through FastCGI. There is no separate FastCGI daemon package for Fedora, so you should use the FastCGI package of lighttpd and install it jointly with php-cli and some PHP5 modules like php-mysql which you require if you want to use MySQL from your PHP scripts. After that open /etc/php.ini and insert the line cgi.fix_pathinfo = 1 right towards the end of the file:
    Code:
    vi /etc/php.ini
    The lighttpd-fastcgi package arrives with the executable /usr/bin/spawn-fcgi which you can use to create FastCGI processes.

  5. #5
    Join Date
    May 2008
    Posts
    2,680

    How to Install Nginx with PHP5 on Fedora 12

    You can modify the default vhost as below scripts on PHP 5
    server {
    listen 80;
    server_name _;



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

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

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root /usr/share/nginx/html;
    }

    location ~ \.php$ {
    root html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
    include fastcgi_params;
    }


    location ~ /\.ht {
    deny all;
    }
    }

  6. #6
    Join Date
    May 2008
    Posts
    2,680

    Re: How to Install Nginx with PHP5 on Fedora 12

    The important part for PHP 5 is the location ~ \.php$ {} stanza. Uncomment it to allow it. Modify the root line to the web site's document root for example root /usr/share/nginx/html;. Please confirm that you change the fastcgi_param line to fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html $ fastcgi_script_name ; because or else the PHP interpreter won't locate the PHP script that you describe in your browser
    Last edited by SalVatore; 09-02-2010 at 03:38 AM.

Similar Threads

  1. How to install PHP5 Framework Symfony
    By Danel in forum Software Development
    Replies: 4
    Last Post: 01-12-2010, 01:26 AM
  2. How to install Gnokii on Fedora 10?
    By Lysander in forum Portable Devices
    Replies: 4
    Last Post: 18-11-2010, 12:49 AM
  3. How to install Apache2 and PHP on Fedora 12
    By Kanakpriya in forum Operating Systems
    Replies: 5
    Last Post: 20-02-2010, 01:43 AM
  4. Can't install fedora
    By InterNetWorKed in forum Operating Systems
    Replies: 2
    Last Post: 03-11-2009, 02:47 PM
  5. Install PHP5 On Fedora 10 and Apache2 with mod_fcgid
    By mauricio in forum Guides & Tutorials
    Replies: 5
    Last Post: 16-03-2009, 10:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,030,230.95280 seconds with 17 queries