THE IT IDEAS

  • Home

Tuesday, 21 April 2015

Use PHP5-FPM with Apache 2 on Ubuntu 14.04

 THE IT IDEAS     17:27     apache2, php5-fpm   

Install Apache by following command

    #sudo apt-get update
    #sudo apt-get install apache2-mpm-event

To use PHP5-FPM with Apache, we need to install libapache2-mod-fastcgi module. The libapache2-mod-fastcgi module is not available in the Ubuntu package. Therefore, we need to update the apt sources. Follow these steps.

    Run the following command to edit the source list:

    #sudo nano /etc/apt/sources.list

    Add the following lines at the end of the file:

    deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
    deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

   
    Save and Close this file.


Install libapache2-mod-fastcgi Module


    #sudo apt-get update
    #sudo apt-get install libapache2-mod-fastcgi

 

Install PHP5-FPM with the following command

    #sudo apt-get install php5-fpm


Create the PHP5-FPM configuration file for Apache

    #sudo nano /etc/apache2/conf-available/php5-fpm.conf

... then add the following lines

    <IfModule mod_fastcgi.c>
    AddHandler php5-fcgi .php
    Action php5-fcgi /php5-fcgi
    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -idle-timeout 900 -socket /var/run/php5-fpm.sock -pass-header Authorization
    <Directory /usr/lib/cgi-bin>
        Require all granted
    </Directory>

    </IfModule>

Save and Close this file.


Enable the new modules and configuration for Apache

    #sudo a2enmod actions fastcgi alias
    #sudo a2enconf php5-fpm

Finally, restart Apache

    #sudo service apache2 restart

 


Use PHP5-FPM with Apache 2 on Ubuntu 14.04

    #sudo nano /var/www/html/info.php

Add the following content to the file

    <?php phpinfo(); ?>

Save and Close this file.

Now open the http://localhost/info.php in browser. Upon success, you will see information about PHP and your server. Your setup is now complete.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

Like Us !!!

Recent Posts

Blog Archive

  • ►  2016 (1)
    • ►  April (1)
  • ▼  2015 (12)
    • ►  August (1)
    • ►  May (2)
    • ▼  April (8)
      • How to run a simple PHP web server
      • Install apache2 Webserver, php5 and php module wi...
      • Use PHP5-FPM with Apache 2 on Ubuntu 14.04
      • Give permission yo users to run command with SUDO
      • Error : Could not load host key: /etc/ssh/ssh_hos...
      • Create SFTP User with chroot in AWS EC2
      • How to Delete ElasticBeanstalk bucket
      • How to Use Python ‘SimpleHTTPServer’ to Serve File...
    • ►  March (1)
  • ►  2014 (23)
    • ►  December (8)
    • ►  November (12)
    • ►  April (2)
    • ►  March (1)
  • ►  2013 (7)
    • ►  December (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (3)
  • ►  2012 (15)
    • ►  December (6)
    • ►  November (9)

Categories

apache2 EC2 error mysql php ubuntu aws aws rds browser github installation linux mount s3 AWS Bucket CentOS Computer DocumentRoot change How to Benchmarking Webserver IP LAMP Restart Computer SCP command SQL SERVER XRDP administrator amazon rds backup basic commands chat command line disable download drupal ec2.chroot environment external storage device fstab functions geoip gmail google home page iis instance internet java mod rewrite mongodb multiple login network password one password php5 php5-fpm php7 private browsing python repair filesystem repo reset password rhel sa password same computer script sftp share skype ssh tomcat ubuntu 16.04 ubuntu16 visudo windows 8 youtube
JobsMagBlogJobsMag.InThingsGuide

Popular Posts

  • How to move github local folder to another location.
    Open your GitHub Clone folder and move ".git" folder to your destination folder. Eg. Clone folder :: /var/www/html/htmwebsite ...
  • How do increase the connection limit for IIS in Windows XP
    Follow the Instruction to increase the Connection limit for iis in Windows XP  Open Command prompt and write down below ment...

Copyright © THE IT IDEAS | Powered by Blogger