Installation of Nginx and PHP under Fedora

Source: Internet
Author: User
Tags php source code

1. Installation of Nginx
    • Nginx Installation
wget https://github.com/nginx/nginx/archive/v1.7.11.zipunzip nginx-1.7.7.zip./configure --prefix=NGINX_INSTALL_PATHmake make -f objs/Makefile installnginx直接在objs下生成Makefile文件.
  • Nginx Module Installation

    The biggest difference between Nginx module and Apache module is that the module needs to be recompiled. The following shows the installation of the Nginx-echo module.

    wget https://github.com/openresty/echo-nginx-module/archive/v0.57.zipMkdir$NGINX _install_path/MODULESMV Echo-nginx-module-0.57.Zip$NGINX _install_path/modules&&Cd$NGINX _install_path/modulesunzip Echo-nginx-module-0.57.Zip CD$NGINX _install_path./configure--Prefix=Nginx_install_path--Add-module=$NGINX _install_path/modules/echo-nginx-module-0.5
2. mysql Installation

MySQL installation can download repo file directly to MySQL website.

wget http://repo.mysql.com/mysql-community-release-fc21-6.noarch.rpmsudo yum install community-mysql-server.x86_64 mysql-workbench-community.x86_64
3. PHP Installation

This is mainly used in php-fpm to execute PHP files, PHP kernel 5.3.3 or more, PHP source code comes with PHP-FPM

wget -c  http://cn2.php.net/distributions/php-5.6.9.tar.gz (due to the large PHP file, it is best to open the breakpoint continued)   /configure -- prefix= /usr/ local /php- 5.6  .9  -- Enable -fpm  -- with  -mysql  make &&  make Installsudo ln -s /usr/local /php-  5.6  .9 /usr/ local /php  

Then we'll install PHP and run PHP-FPM, but before we do, we need to

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf

We will now use the default configuration inside, and then go to the Sbin directory to open the PHP-FPM service.

sudo sbin/php-fpm
4. Configure PHP under Nginx
 location ~* \.php$ {            127.0.0.1:9000;            SCRIPT_FILENAME$document_root$fastcgi_script_name;            PATH_INFO$fastcgi_script_name;            include fastcgi_params;        }

Now start Nginx
Add the index.php file to the HTML directory.

<?phpphpinfo();?>

Visit http://localhost/index.php
Appear

This way, the installation configuration of Nginx and PHP is complete.

Installation of Nginx and PHP under Fedora

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.