VPS business hosting starting at $29.95/24/7 premium technical support

[SOLVED] PHP must be run as a CLI application error : Content-type: text/html; charset=UTF-8

php bin/magento cache:clean
Content-type: text/html; charset=UTF-8
bin/magento must be run as a CLI application

as root user, run the following commands (For php v7.0)

# yum install ea-php70
# source /opt/cpanel/ea-php70/enable

The solution involves fixing php variable’s path. We need to find which php is being used right now, you can find out by

$ which php
$ php -v

To fix this PHP cli error, see how to edit php in bash profile (.bashrc)

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

One thought on “[SOLVED] PHP must be run as a CLI application error : Content-type: text/html; charset=UTF-8”

Leave a Reply

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