Join the community today
Become a Member

PHP-FPM PHP: Command not found

Discussion in 'Install & Upgrades or Pre-Install Questions' started by nVidian, Feb 23, 2016.

Tags:
  1. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    Hi, is PHP CLI not installed by default ?

    Cenminmod 1.2.3-eva2000.08 stable

    Code:
    # php -v
    bash: php: command not found
    
    # php --ri ioncube
    bash: php: command not found
    
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    is this a fresh new install ? looks like php failed to install

    You'll need to post on the forums with the following info
    • Server or VPS details ? XEN, KVM, OpenVZ, VMWare or dedicated server ? OS ? CentOS 6.7 or 7.2 ? 32bit or 64bit ?
    • What version of Centmin Mod ? .07 stable or 08 stable or .09 beta01 or another branch version ?
    • Was it fresh install or upgrade ?
    • Method of install ? Via centmin.sh menu option 1, Git install or curl one liner install as outlined at centminmod.com/download.html ?
    • How long ago did you install Centmin Mod ?
    • There's numerous code changes, bug fixes over time, so ensure you have latest Centmin Mod code installed by upgrading your Centmin Mod code as instructed below.

    Troubleshooting Initial Install



    To troubleshoot initial installation, you need to check the initial install log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the initial install log. You can see full details at How to troubleshoot Centmin Mod initial install issues

    Upgrading Centmin Mod Code to Latest Version



    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod - CentminMod.com LEMP Nginx web stack for CentOS This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at Upgrade - How to upgrade Centmin Mod | Centmin Mod Community
    So essentially, you can upgrade from .07 to .08 in place, but not everything is upgraded as some things like server initial environment setup isn't changed i.e. how swap, tmp setup and allocation are created etc. The main parts from part 2 above are what in place upgrades do i.e. Nginx and PHP-FPM compilation and config/settings parameters and MariaDB version from 5.5 to 10.0.x. If you want the full environment changed including tmp and swap setup to .08's configuration, then you would need a fresh OS install and fresh .08 initial install. You can think of it like upgrading Windows 7 to Windows 8. An in place upgrade will upgrade code but won't change your computer environment from when you installed Windows 7 i.e. disk configuration and partition sizes won't change from when you initially installed Windows 7. Only way to change that would be fresh Windows 8 install.
     
  3. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    Hi George, I always love Centminmod, thats why now I come back again to use centminmod for my new project.
    I'm surprised & a bit confused cause there are a lot of branches now, but sure its really great news for Centminmod project !!!

    About the branches, do they different in terms of 'what to install' ? Example: NGINX+PHP-FPM+MariadDB branch, OpenLiteSPeed+LSWS PHP branch etc ?? How do I find documentation about differences between those branches ?

    To answer your questions:
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    Each stable and beta main branches have their own dedicated thread for updates related to those branches, there's only 2 official
    Rest of branches are old or experimental for new features I am testing etc.
     
  5. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    This is my 3rd centminmod install on Linode 1Gb KVM. Centminmod installed using "Method 2: centmin.sh via Git"

    Fresh OS Centos 6.5 from Linode, No yum update either.

    Code:
    # php -v
    bash: php: command not found
    
    # nginx -v
    bash: nginx: command not found

    BUT THOSE SERVICES ARE RUNNING:


    Code:
    # service php-fpm restart
    Gracefully shutting down php-fpm . done
    Starting php-fpm  done
    
    # service nginx restart
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
    Stopping nginx:  [  OK  ]
    Starting nginx:  [  OK  ]
    Is this failed installation or just path issue ? Thank you
     
  6. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    Only way to know is with the install log. To troubleshoot initial installation, you need to check the initial install log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the initial install log. You can see full details atHow to troubleshoot Centmin Mod initial install issues

    What does output of these commands give ?
    Code:
    which php
    which nginx
    what bout using method 3 install via curl installer ?
     
  7. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    TRY TO FIX THAT
    Code:
    # whereis php
    php: /usr/local/bin/php /usr/local/lib/php.ini /usr/local/lib/php /usr/local/php
    
    # ln -s /usr/local/bin/php /usr/bin/php
    
    ]# php -v
    PHP 5.4.45 (cli) (built: Mar  6 2016 12:37:16)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
        with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies
    Code:
    # whereis nginx
    nginx: /usr/local/sbin/nginx /usr/local/nginx
    
    # ln -s /usr/local/sbin/nginx /usr/bin/nginx
    
    # nginx -v
    nginx version: nginx/1.9.12
    Is this should be alright now or not ? Can I start to use the server ? Should I reinstall everything ?

    Thanks
     
  8. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    Which log do you want to see ?
    Code:
    # ls /root/centminlogs
    centminmod_1.2.3-eva2000.08_060316-124501_update_all.log          centminmod_profiletimes_060316-185336.log
    centminmod_1.2.3-eva2000.08_060316-124501_yuminstall_centos6.log  centminmod_yumtimes_060316-124501.log
    centminmod_1.2.3-eva2000.08_060316-185336_install.log             centminmod_yumtimes_060316-185336.log
    centminmod_1.2.3-eva2000.08_060316-185336_yuminstall_centos6.log  gcc_native.log
    centminmod_1.2.3-eva2000.08_060316-185336_yum-log.log             install.utc.time.log
    centminmod_ngxinstalltime_060316-185336.log                       securedtmp.log
    centminmod_opensslinstalltime_060316-185336.log                   timedhosts_060316-124501.txt
    centminmod_phpinstalltime_060316-185336.log                       timedhosts_060316-185336.txt
    centminmod_profiletimes_060316-124501.log                         zendopcache_passfile.txt
    
    Log text file is very long . how do I report it here ?
     
  9. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    that's not correct way to fix it for centmin mod as those /usr/local/nginx and /usr/bin/nginx paths are for non-Centmin Mod installs, so that means you either have a yum packaged nginx/php-fpm install on the system already or another installed instance elsewhere that Centmin Mod didn't install.

    I'd get a copy of your install log (centminmod_1.2.3-eva2000.08_060316-185336_install.log) saved and then reload OS and install via method 3 and see
     
  10. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    Are you running commands as root user or did you setup sudo user ? Centmin Mod 123.08stable isn't setup for sudo users only for root user. Centmin Mod 123.09beta01 has sudo user support added for post Centmin Mod install sudo usage
     
  11. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    Yes I ran under sudo user, 'sudo su' after login from other SSH user.

    EDITED: I dont know is it 'run under sudo user' or not ? If everytime I immediately run 'sudo su' after SSH login. Should I use 'su root' instead ?
     
  12. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
  13. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
  14. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    I wouldn't install Centmin Mod as sudo user but as root. But AFTER Centmin Mod 123.09beta01 installed, you can use sudo user as Centmin Mod auto sets up additional paths for sudo user to work properly. You won't have those additional paths BEFORE Centmin Mod install. Centmin Mod 123.08stables DOES NOT have any of the additonal paths for sudo user etc.
     
  15. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    Sorry for my dumb questions ,
    If I want to install in 'root' mode, Which command should I run so I could be a 'complete' root after SSH login ?
    • su root
    • sudo -i
    Or should I login completely as root ?
     
  16. eva2000

    eva2000 Administrator Staff Member

    29,041
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    8:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    log in as root is only way for Centmin Mod 123.08stable as i was never made for sudo. Centmin Mod 123.09beta01 has been updated to fix that for after Centmin Mod installs.
     
  17. nVidian

    nVidian Member

    85
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    5:10 PM
    1.7.9
    5.5
    Thanks. I'll try to install as root then.