Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-02-2010
Member
 
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
Reply With Quote
  #2  
Old 09-02-2010
Member
 
Join Date: Nov 2005
Posts: 3,023
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.
Reply With Quote
  #3  
Old 09-02-2010
Member
 
Join Date: May 2008
Posts: 2,676
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.
Reply With Quote
  #4  
Old 09-02-2010
Member
 
Join Date: Nov 2005
Posts: 3,023
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.
Reply With Quote
  #5  
Old 09-02-2010
Member
 
Join Date: May 2008
Posts: 2,676
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;
}
}
Reply With Quote
  #6  
Old 09-02-2010
Member
 
Join Date: May 2008
Posts: 2,676
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.
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 12:47 AM.