Method: 1. Use "yum install php-devel php-pear httpd-devel" to install PHP and apache for development development; 2. Use "wget http://pear.php.net/go-pear" Download the "go-pear" script.
The operating environment of this article: centos 7 system, Dell G3 computer.
1. This problem occurs because the extension development of php is not installed. It is recommended to install both php and apache development. Use the following Order.
yum install php-devel php-pear httpd-devel
2. It means that you did not compile pear when installing php, so you had to go to the official website http://pear.php.net.
Officially provides two ways to install pear:
1. Add the pear configuration module when compiling PHP.
2. go-pear method.
I tried the go-pear method.
Download go-pear script
wget http://pear.php.net/go-pear
Rename:
mv go-pear go-pear.php
Execute script
php go-pear.php
Recommended tutorial: "centos tutorial"
The above is the detailed content of What should I do if the pear command cannot be used in centos?. For more information, please follow other related articles on the PHP Chinese website!