Install Nginx/PHP-FPM on Fedora 29/28, CentOS/RHEL 7.5/6.10 - Comment Page: 4

This is guide howto install Nginx with PHP 7.2.12 and PHP-FPM on Fedora 29/28/27, CentOS 7.5/6.10 and Red Hat (RHEL) 7.5/6.10. PHP-FPM is easier to use and configure than FastCGI and some tests says that PHP-FPM is even much more efficient than FastCGI. Nginx (engine x) is a robust, small and high performance http server, reverse proxy server and also mail proxy server. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. 1. Install Nginx, PHP 7.2.12 and PHP-FPM on Fedora 29/28/27, CentOS 7.5/6.10, Red Hat (RHEL) 7.5/6.10 [inttf_post_ad1] 1.1 Change to root...

198 comments on “Install Nginx/PHP-FPM on Fedora 29/28, CentOS/RHEL 7.5/6.10 - Comment Page: 4

1 2 3 4 5 6
    1. Hello JR, Great article. But i can’t seem to run my centos 5.8 with this setup(maybe it’s not suitable for this version but i had no errors during installation). I’ve made every step like in this article(changed name from testsite.local to salomon, added 90.156.232.212 salomon
      to /etc/hosts file), but when i try to show test page by adressing ip adress http://90.156.232.212/ – error 118 (net::ERR_CONNECTION_TIMED_OUT): operation timeout is written.

      Reply
      • First make sure nginx is running:
        service nginx status

        If it’s running make sure in /etc/sysconfig/iptables you added the line:
        -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
        before the line containing REJECT one and not after.

        Reply
    2. […] can checkout this link also for installing and configuring nginx. Link You may configure in nginx.conf file […]

      Reply
    3. A useful set of self-contained packages for PHP. Thanks!

      One snag I’ve just hit, though, is that I’m trying to install a Symfony v2-based app with your php 5.4 (avoiding 5.5 for now) and your php-intl 5.4.15 package. But there’s no libicu 4 in your ‘remi’ repository (which Symfony v2 would prefer), only in your ‘remi-test’ (which wants to pull in all the php 5.5 dependencies)

      Reply
    4. Hello JR,
      Nice tutorial you have here.
      I have a problem , hope you would help me.
      I have setup a server with nginx to host 3 website on it by following one of your tutorial, lets name them http://www.abc.com , http://www.def.com , http://www.ghi.com , and they are running fine.
      Their configuration files are each located at their respective place /etc/nginx/sites-available/abc , /etc/nginx/sites-available/def , /etc/nginx/sites-available/ghi
      The php files for the respective website are located at /home/abc/public_html/ , /home/def/public_html/ , /home/ghi/public_html/
      Now my problem is, if i would like to add an error 404 handler on 1 of the website only, assuming “def”, how do i edit the config file at /etc/nginx/sites-available/def to redirect all error 404 to a page error404.php ?
      I’ve created an error404.php file in /home/def/public_html/
      i would like the error 404 handler to redirect mistype of links or non-existence page to the error404.php file.
      Hope you would help me with this problem.
      Thank you

      Reply
      • Hi yeemin,

        Thanks!

        If you want def site-wide error page, then following should work on /etc/nginx/sites-available/def:

        
        server {
            ...
            error_page  404  /error404.php;
            ...
        }
        
        Reply
    5. :) Great tutorial!! thanks. somehow I am not able to access the testsite.local even after applying firewall rule and restarting iptables. How ever I am able to access the nginx frontpage via the local IP address but not the phpinfo. can you pls suggest/comment what I am doing wrong?

      Reply
    6. sorry, didnt make myself clear in last post. I meant, I am not able to access the phpinfo REMOTELY

      Reply
      • Hi tapash,

        You can’t use testsite.local remotely, because it’s not real domain, but you can add your ip address to your virtual host file, like:

        
        server {
            server_name your_public_ip_address_here;
            ...
        }
        

        Or alternatively you can add testsite.local to your remote machine /etc/hosts file and point it to your server public ip.

        Reply
    7. php 5.5.3 problem – Unable to load dynamic library ‘/usr/lib64/php/modules/gd.so’

      Reply
      • Hi Evgen,

        Could you post output of following commands:

        
        rpm -qa php\*
        
        ls -la /usr/lib64/php/modules/gd.so
        
        Reply
        • No, sorry. It was CentOS 6.4 x64

          Reply
          • Okay, so you get it working?

            Reply
    8. Fedora 14 error apache

      apache + 1024 conexions maximon

      configuracion apache
      maxclients 4096
      Serverlimit 4096

      Selinux disabled
      Limits.conf 4096

      resolved ?

      Reply
    9. Thank’s man , it’s working :P

      Reply
    10. Thanks for this tutorial. Was having a hard time installing php 5.5 with nginx, but this helped out a bunch.

      Reply
    11. Thanks for this great tutorial. I am a bit stuck on step 7.

      I have created the virtual host and directory structure for a domain I will eventually move to this server, but which for now is hosted elsewhere, so I don’t want to mess with the domain in my local hosts file.

      Is there another way I can access the new folder in my browser to test the php file is working? Like by using the IP address or something? Right now when I visit my assigned IP it still says “welcome to nginx”.

      Also, how do you eventually point the domain to that folder in your DNS hosting?

      Reply
      • Hi Damien,

        You could you create some subdomain, like test.yoursite.com and then change that address dns record point to your (new) server ip. Setup your site there and do real testing to see that everything works as expected and when everything is ready, then change your real domain to point your new server.

        When testing, your virtual host file should start like:

        
        server {
            server_name test.yoursite.com;
            ...
        }
        

        And when you are sure it works, then virtual host should start like:

        
        server {
            server_name www.yoursite.com;
            ...
        }
        

        And you can change real domain to point your (new) server ip.

        Reply
    12. Hi JR,
      I followed your guide and installed nginx + PHP-FPM, but now I have issue installing phpmyAdmin. I get the following issues :


      yum --enablerepo=remi,remi-test install phpmyadmin
      Loaded plugins: fastestmirror, refresh-packagekit
      Loading mirror speeds from cached hostfile
      * base: mirror.ovh.net
      * epel: ftp.nluug.nl
      * extras: mirror.ovh.net
      * remi: rpms.famillecollet.com
      * remi-test: rpms.famillecollet.com
      * updates: mirror.ovh.net
      Setting up Install Process
      Resolving Dependencies
      --> Running transaction check
      ---> Package phpMyAdmin.noarch 0:4.1.12-1.el6.remi will be installed
      --> Processing Dependency: php-tidy for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Processing Dependency: php-tcpdf-dejavu-sans-fonts for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Processing Dependency: php-tcpdf for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Processing Dependency: php-recode for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Processing Dependency: php-php-gettext for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Processing Dependency: php-gmp for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Processing Dependency: php-bcmath for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Running transaction check
      ---> Package php-bcmath.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-bcmath-5.4.26-1.el6.remi.x86_64
      ---> Package php-php-gettext.noarch 0:1.0.11-4.el6.remi will be installed
      ---> Package php-recode.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-recode-5.4.26-1.el6.remi.x86_64
      --> Processing Dependency: librecode.so.0()(64bit) for package: php-recode-5.4.26-1.el6.remi.x86_64
      ---> Package php-tcpdf.noarch 0:6.0.061-1.el6.remi will be installed
      ---> Package php-tcpdf-dejavu-sans-fonts.noarch 0:6.0.061-1.el6.remi will be installed
      --> Processing Dependency: dejavu-sans-fonts for package: php-tcpdf-dejavu-sans-fonts-6.0.061-1.el6.remi.noarch
      ---> Package php-tidy.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-tidy-5.4.26-1.el6.remi.x86_64
      --> Processing Dependency: libtidy-0.99.so.0()(64bit) for package: php-tidy-5.4.26-1.el6.remi.x86_64
      ---> Package phpMyAdmin.noarch 0:4.1.12-1.el6.remi will be installed
      --> Processing Dependency: php-gmp for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Running transaction check
      ---> Package dejavu-sans-fonts.noarch 0:2.30-2.el6 will be installed
      --> Processing Dependency: dejavu-fonts-common = 2.30-2.el6 for package: dejavu-sans-fonts-2.30-2.el6.noarch
      ---> Package libtidy.x86_64 0:0.99.0-19.20070615.1.el6 will be installed
      ---> Package php-bcmath.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-bcmath-5.4.26-1.el6.remi.x86_64
      ---> Package php-recode.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-recode-5.4.26-1.el6.remi.x86_64
      ---> Package php-tidy.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-tidy-5.4.26-1.el6.remi.x86_64
      ---> Package phpMyAdmin.noarch 0:4.1.12-1.el6.remi will be installed
      --> Processing Dependency: php-gmp for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      ---> Package recode.x86_64 0:3.6-28.1.el6 will be installed
      --> Running transaction check
      ---> Package dejavu-fonts-common.noarch 0:2.30-2.el6 will be installed
      ---> Package php-bcmath.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-bcmath-5.4.26-1.el6.remi.x86_64
      ---> Package php-recode.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-recode-5.4.26-1.el6.remi.x86_64
      ---> Package php-tidy.x86_64 0:5.4.26-1.el6.remi will be installed
      --> Processing Dependency: php-common(x86-64) = 5.4.26-1.el6.remi for package: php-tidy-5.4.26-1.el6.remi.x86_64
      ---> Package phpMyAdmin.noarch 0:4.1.12-1.el6.remi will be installed
      --> Processing Dependency: php-gmp for package: phpMyAdmin-4.1.12-1.el6.remi.noarch
      --> Finished Dependency Resolution
      Error: Package: php-tidy-5.4.26-1.el6.remi.x86_64 (remi)
      Requires: php-common(x86-64) = 5.4.26-1.el6.remi
      Installed: php-common-5.5.10-1.el6.remi.1.x86_64 (@remi-php55)
      php-common(x86-64) = 5.5.10-1.el6.remi.1
      Available: php-common-5.3.3-26.el6.x86_64 (base)
      php-common(x86-64) = 5.3.3-26.el6
      Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
      php-common(x86-64) = 5.3.3-27.el6_5
      Available: php-common-5.4.25-2.el6.remi.x86_64 (remi)
      php-common(x86-64) = 5.4.25-2.el6.remi
      Available: php-common-5.4.26-1.el6.remi.x86_64 (remi)
      php-common(x86-64) = 5.4.26-1.el6.remi
      Error: Package: php-bcmath-5.4.26-1.el6.remi.x86_64 (remi)
      Requires: php-common(x86-64) = 5.4.26-1.el6.remi
      Installed: php-common-5.5.10-1.el6.remi.1.x86_64 (@remi-php55)
      php-common(x86-64) = 5.5.10-1.el6.remi.1
      Available: php-common-5.3.3-26.el6.x86_64 (base)
      php-common(x86-64) = 5.3.3-26.el6
      Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
      php-common(x86-64) = 5.3.3-27.el6_5
      Available: php-common-5.4.25-2.el6.remi.x86_64 (remi)
      php-common(x86-64) = 5.4.25-2.el6.remi
      Available: php-common-5.4.26-1.el6.remi.x86_64 (remi)
      php-common(x86-64) = 5.4.26-1.el6.remi
      Error: Package: php-recode-5.4.26-1.el6.remi.x86_64 (remi)
      Requires: php-common(x86-64) = 5.4.26-1.el6.remi
      Installed: php-common-5.5.10-1.el6.remi.1.x86_64 (@remi-php55)
      php-common(x86-64) = 5.5.10-1.el6.remi.1
      Available: php-common-5.3.3-26.el6.x86_64 (base)
      php-common(x86-64) = 5.3.3-26.el6
      Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
      php-common(x86-64) = 5.3.3-27.el6_5
      Available: php-common-5.4.25-2.el6.remi.x86_64 (remi)
      php-common(x86-64) = 5.4.25-2.el6.remi
      Available: php-common-5.4.26-1.el6.remi.x86_64 (remi)
      php-common(x86-64) = 5.4.26-1.el6.remi
      Error: Package: phpMyAdmin-4.1.12-1.el6.remi.noarch (remi)
      Requires: php-gmp
      Available: php-common-5.3.3-26.el6.x86_64 (base)
      php-gmp
      Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
      php-gmp
      Available: php-common-5.4.25-2.el6.remi.x86_64 (remi)
      php-gmp
      Available: php-common-5.4.26-1.el6.remi.x86_64 (remi)
      php-gmp
      Installed: php-common-5.5.10-1.el6.remi.1.x86_64 (@remi-php55)
      Not found
      You could try using --skip-broken to work around the problem
      You could try running: rpm -Va --nofiles --nodigest

      Please help.

      Reply
      • Hi venomdog,

        Try following:

        
        yum --enablerepo=remi,remi-php55,remi-test install phpmyadmin
        
        Reply
    13. Hi JR,
      Thanks for your reply I cannot try your solution now because it was so frsutrating that I re-installed everything and now all works. This time didn’t follow your guide though but sure will check those tips and trick for php-fpm stuff. Thanks for great articles ad tutorials.

      Reply
    14. Hi JR,
      I had same issue, adding remi-php55 fixed it. Thanx! :)

      Reply
1 2 3 4 5 6

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close