PHP Cli not running after migrate to EasyApache 4
Hello,
I running VPS Server on GoDaddy.
After migrate to EasyApache 4 due to requirments for Magento 2.1 php commands are not acceptable.
php bin/magento saying:
If i try to do php-cli as an other server works php-cli instead of php only its saying :
So im struggling find how to fix the issue. Server is new just started. Installed EasyApache 4 and update WHM to last version 62.0..
Any suggestions? All help will be very appreciated!
php bin/magento cache:flush
Content-type: text/html; charset=UTF-8
bin/magento must be run as a CLI application[root@xxx-xx www.xxx-xxx.com]#
If i try to do php-cli as an other server works php-cli instead of php only its saying :
php-cli bin/magento cashe:flush
bash: php-cli: command not found
So im struggling find how to fix the issue. Server is new just started. Installed EasyApache 4 and update WHM to last version 62.0..
PHP Version is: 7.0.16
[root@xxx-xxx www.xxx-xxx.com]# php -v
ea-php-cli Copyright 2016 cPanel, Inc.
PHP 7.0.16 (cgi-fcgi) (built: Feb 22 2017 20:52:04)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.16, Copyright (c) 1999-2017, by Zend Technologies
[root@xxx-xxx www.xxx-xxx.com]#
Any suggestions? All help will be very appreciated!
-
php70-cli is installed as well.. [root@xxx-xxx www.xxx-xxx.com]# yum search php70-php-cli Loaded plugins: fastestmirror, tsflags, universal-hooks Loading mirror speeds from cached hostfile * EA4: 104.219.172.10 * base: mirror.lax.hugeserver.com * extras: mirrors.usc.edu * updates: centos.mirrors.hoobly.com ===================================== N/S Matched: php70-php-cli ===================================== ea-php70-php-cli.x86_64 : Command-line interface for PHP
Name and summary matches only, use "search all" for everything.[root@xxx-xxx www.xxx-xxx.com]# yum install ea-php70-php-cli.x86_64 Loaded plugins: fastestmirror, tsflags, universal-hooks Setting up Install Process Loading mirror speeds from cached hostfile * EA4: 104.219.172.10 * base: mirror.lax.hugeserver.com * extras: mirrors.usc.edu * updates: centos.mirrors.hoobly.com Package ea-php70-php-cli-7.0.16-1.1.2.cpanel.x86_64 already installed and latest version Nothing to do [root@xxx-xxx www.xxx-xxx.com]#0 -
Problem SOLVED: was need to do : [root@xxx-xxx ea-php70]# yum install ea-php70 Loaded plugins: fastestmirror, tsflags, universal-hooks Setting up Install Process Loading mirror speeds from cached hostfile * EA4: 104.219.172.10 * base: mirror.lax.hugeserver.com * extras: mirrors.usc.edu * updates: centos.mirrors.hoobly.com Package ea-php70-7.0.16-1.1.1.cpanel.x86_64 already installed and latest version Nothing to do [root@xxx-xxx ea-php70]# source /opt/cpanel/ea-php70/enable [root@xxx-xxx ea-php70]# cd /home/xxx/public_html/www.xxx-xxx.com/ [root@xxx-xxx www.xxx-xxx.com]# php bin/magento cache:flush Flushed cache types: config layout block_html collections reflection db_ddl eav config_integration config_integration_api full_page translate config_webservice [root@xxx-xxx www.xxx-xxx.com]#
Maybe someone esle will have this issue and would be usefull.0 -
Problem Solved Temporary. Every time i exit, problem exist again. Someone give me a suggestion how to make permanent source /opt/cpanel/ea-php70/enable? 0 -
Just try to use the full path of phpcli binary 0 -
How to use full path? 0 -
Hello, Please let us know if the information on the following document helps: EasyApache 4 and the ea-php-cli Package - EasyApache 4 - cPanel Documentation Thank you. 0 -
Hello Michael, Thanks fot the info, i read it, but its written only difference between cgi and cli. Please tell me how to switch from php70 (cgi-fcgi) to php70 (cli) permanent to run the commands over SSH. 0 -
Hi, Instead of using 'php', you need to use the full path of '/usr/local/bin/php'. This is the CLI version of the PHP binary 0 -
My other VPS @ Godaddy was okay to use the php instead of full path. Right now command execute with php-cli. So there is some way to make this happen. When i check version with php -v if appear PHP 7.0.16 (cli) instead of PHP 7.0.16 (cgi-fcgi), php execute is correct. Is anyone familiar how to change it for ssh? P.S: when execude this: source /opt/cpanel/ea-php70/enable, php has been changed temporary to PHP 7.0.16 (cli), php command executing fine till next login. 0 -
My other VPS @ Godaddy was okay to use the php instead of full path. Right now command execute with php-cli.
It's likely that server used a different version of cPanel, or did not utilize EasyApache 4.So there is some way to make this happen. When i check version with php -v
You may find this third-party URL helpful: EasyApache 4 & CLI based PHP utilities " Liquid Web Knowledge Base If you need to make it work in every SSH session, then you could add the command to the bash profile: How to Set and Unset Local, User and System Wide Environment Variables in Linux Thank you.0 -
My other VPS @ Godaddy was okay to use the php instead of full path. Right now command execute with php-cli. So there is some way to make this happen. When i check version with php -v if appear PHP 7.0.16 (cli) instead of PHP 7.0.16 (cgi-fcgi), php execute is correct. Is anyone familiar how to change it for ssh? P.S: when execude this: source /opt/cpanel/ea-php70/enable, php has been changed temporary to PHP 7.0.16 (cli), php command executing fine till next login.
Problem Solved Temporary. Every time i exit, problem exist again. Someone give me a suggestion how to make permanent source /opt/cpanel/ea-php70/enable?
Hello, I've searched the internet over 14 hours to find your post. I am also on GoDaddy and I also have their VPS service and EasyApache4. My problem, however started to surface today when I was following instructions to install the latest version of git for CentOS and followed these commands: cd git-2.0.1 make prefix=/usr/local/git all make prefix=/usr/local/git install echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc source /etc/bashrc Anyway, I can't thank you enough for find out that using source /opt/cpanel/ea-php70/enable command changes the php to CLI mode but I am having trouble making this permanent. I've read the article link provided by cPanelMichael, but I am having difficulties understanding it and thus am not able to make this solution permanent. I've tried: echo "export PATH=$PATH:/opt/cpanel/ea-php70/root/usr/bin:/opt/cpanel/ea-php70/root/usr/sbin${PATH:+:${PATH}} >> /etc/bashrc and echo "export PATH=$PATH:/opt/cpanel/ea-php70/root/usr/bin:/opt/cpanel/ea-php70/root/usr/sbin${PATH:+:${PATH}} >> /etc/bashrc and then source /etc/bashrc but when I sign out and sign back in, I have to run source /opt/cpanel/ea-php70/enable again. What did you end up doing to make this permanent? Thank you for your help.0 -
I got it to work! I ended up adding editing the bashrc file as the way I was entering it duplicated existing export PATH settings. I edited all the duplicates out and the end result was: export PATH=/opt/cpanel/ea-php70/root/usr/bin:/opt/cpanel/ea-php70/root/usr/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/usr/local/git/bin export MANPATH=/opt/cpanel/ea-php70/root/usr/share/man: It worked out beautifully! All thanks to you and to Michael! I actually understood his article. :D 0 -
I got it to work! I ended up adding editing the bashrc file as the way I was entering it duplicated existing export PATH settings. I edited all the duplicates out and the end result was: export PATH=/opt/cpanel/ea-php70/root/usr/bin:/opt/cpanel/ea-php70/root/usr/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/usr/local/git/bin export MANPATH=/opt/cpanel/ea-php70/root/usr/share/man: It worked out beautifully! All thanks to you and to Michael! I actually understood his article. :D
Apparently this was not the final piece of the puzzle. After I've saved the bashrc file, sudo, vi, yum commands did not work. I I went ahead and restored the order back to the way it was but now cgi-fcgi is showing when I type php -v. Help Please?0 -
I can't believe it was as simple as just adding your command to the /etc/bashrc file!! Now everything works well!! 0 -
Hello Tipofloe, Can you please help me resolve my issue. What i have to do to keep it permanent? Thank you in advance? 0 -
I can't believe it was as simple as just adding your command to the /etc/bashrc file!! Now everything works well!!
Hello @tipofloe, Could you post the updated steps/commands you used to ensure the changes were preserved? Thanks!0
Please sign in to leave a comment.
Comments
16 comments