centos下php安装pear模块并配置虚拟主机支持Pear模块
wget php go-pear提示
Sorry! Your PHP version is too new (5.2.14) for this go-pear.下载新版本wget
php go-pear.phar 然后提示1. Installation base ($prefix) : /usr/local/php
2. Temporary directory for processing : /tmp/pear/install 3. Temporary directory for downloads : /tmp/pear/install 4. Binaries directory : /usr/local/php/bin 5. PHP code directory ($php_dir) : /usr/local/php/share/pear 6. Documentation directory : /usr/local/php/docs 7. Data directory : /usr/local/php/data 8. User-modifiable configuration files directory : /usr/local/php/cfg 9. Public Web Files directory : /usr/local/php/www10. Tests directory : /usr/local/php/tests11. Name of configuration file : /usr/local/php/etc/pear.conf1-11, 'all' or Enter to continue:
点击确认默认安装就ok。
然后提示:Would you like to alter php.ini ? [Y/n] : Y
确认更新php.ini配置文件。
/usr/local/php/bin/pear channel-update pear.php.net
/usr/local/php/bin/pear install HTML_Template_Sigma可以把/usr/local/php/bin/加入到PATH变量中。
pear install db
Warning: include_once(): open_basedir restriction in effect. File(/usr/share
限制虚拟主机权限? (Y/n):这里请一定要输入“n”,不限制权限,否则将会出现前面所说的“open_basedir restriction in effect”的错误!
修改虚拟主机配置文件httpd-vhosts.conf,如下
<Directory /home/wwhttpd-vhosts.conf
w/default/>^MOptions +Includes -Indexes^MRequire all grantedAllowOverride All^Mphp_admin_value open_basedir /home/www/default:/usr/share/pear:/usr/local/pear/share/pear:/tmp:/proc^M</Directory>^M</virtualhost>^MInclude conf/vhost/*^M