linux 下php环境搭建
Centos 先用root安装这一堆
yum install libpng
yum install libpng-devel
yum -y install libjpeg-devel
yum -y install curl-devel
yum install bzip2
yum install bzip2-devel
yum install libxml2
yum install libxml2-devel -y
yum install libmcrypt
yum install libmcrypt-devel
php安装:
http://jingyan.baidu.com/article/29697b91145c44ab20de3ccf.html
makefile
./configure --prefix=/data/php --enable-fpm --with-mcrypt \--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \--with-gd --with-jpeg-dir
make
出现一些错误:
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt] XFAIL REASON: Still not quite right
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt] XFAIL REASON: Still not quite right
Bug #42718 (unsafe_raw filter not applied when configured as default filter) [ext/filter/tests/bug42718.phpt] XFAIL REASON: FILTER_UNSAFE_RAW not applied when configured as default filter, even with flags
Bug #67296 (filter_input doesn't validate variables) [ext/filter/tests/bug49184.phpt] XFAIL REASON: See Bug #49184
zend multibyte (7) [ext/mbstring/tests/zend_multibyte-07.phpt] XFAIL REASON: https://bugs.php.net/bug.php?id=66582
zend multibyte (9) [ext/mbstring/tests/zend_multibyte-09.phpt] XFAIL REASON: https://bugs.php.net/bug.php?id=66582
Bug #45712 (NaN/INF comparison) [ext/standard/tests/math/bug45712.phpt] XFAIL REASON: Bug 45712 not fixed yet.
=====================================================================
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #52202 (CURLOPT_PRIVATE gets clobbered) [ext/curl/tests/bug52202.phpt]
Phar: phpinfo display 1 [ext/phar/tests/phpinfo_001.phpt]
Phar: phpinfo display 2 [ext/phar/tests/phpinfo_002.phpt]
Phar: phpinfo display 4 [ext/phar/tests/phpinfo_004.phpt]
Test setlocale() function : usage variations - Setting all available locales in the platform [ext/standard/tests/strings/setlocale_variation2.phpt]
=====================================================================
=====================================================================
WARNED TEST SUMMARY
---------------------------------------------------------------------
zend multibyte (2) [ext/mbstring/tests/zend_multibyte-02.phpt] (warn: XFAIL section but test passes)
zend multibyte (6) [ext/mbstring/tests/zend_multibyte-06.phpt] (warn: XFAIL section but test passes)
=====================================================================
You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]: n
不用管,继续安装
make install
chown root /安装目录/sbin/php-fpm
chmod u+s /安装目录/sbin/php-fpm
拷贝配置文件
cp php.ini-production /安装目录/lib/php.ini #php配置文件
cp /安装目录/etc/php-fpm.conf.default /安装目录/etc/php-fpm.conf #php-fpm配置文件
设置你的配置文件
vi php-fpm.conf
user = 你创建的非root用户
group = 你创建的非root用户组
启动php-fpm
/安装目录/sbin/php-fpm
结束进程php-fpm(root权限)
pkill php-fpm
查看是否启动成功:
netstat -lnt | grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
启动nginx
/安装目录/nginx/nginx
测试一下数据库的连接:
<?php
echo"asdasdasd";
$DB = mysql_connect ( "数据库地址" , "用户名" , "密码" ) ;
if($DB)
{echo "链接成功";}
else
{echo "链接失败";}?>
Notice: Undefined variable的解决办法:
http://www.shangxueba.com/jingyan/1919822.html
PHP默认配置会报这个错误,我的PHP版本是5.2.13,存在这个问题:
Notice: Undefined variable
这就是将警告在页面上打印出来,虽然这是有利于暴露问题,但实现使用中会存在很多问题。
需要设置显示错误级别,来解决问题。
网络上的通用解决办法是修改php.ini的配置:
解决方法:
1) error_reporting设置:
找到error_reporting = E_ALL
修改为error_reporting = E_ALL & ~E_NOTICE
相关推荐
Linux下PHP环境搭建.doc httpd-2.2.11.tar.gz安装说明 php-5.1.2.tar.bz2安装说明 zlib-1.2.3.tar.gz安装说明 libxml2-2.7.3.tar.gz安装说明 gd-2.0.28.tar.gz安装说明 mysql-5.0.33.tar.gz安装说明
window,linux下php环境搭建.doc
window,linux下php环境搭建参考.pdf
window,linux下php环境搭建分享.pdf
linux搭建php开发环境图文教程,绝不骗积分请大家放心下载.
Linux+Apache2.4+PHP7.1+MySQL5.7
NULL 博文链接:https://liangfuming.iteye.com/blog/1565237
Linux下安装Apache+PHP+MySql搭建PHP运行环境
phpStudy PHP环境集成包 PHP环境一件搭建 Linux版 Win版
PHP在linux系统下的环境搭建过程 PHP在linux系统下的环境搭建过程 PHP在linux系统下的环境搭建过程
如何在linux服务器上同时搭建php运行环境(apache)和java运行环境(tomcat) 一台linux上同时运行php和java网站项目 一台linux上同时运行apache httpd和java tomcat
Linux下完整的PHP开发环境搭建文档。lanmp环境,库文件加载。
Linux下PHP环境搭建[second].doc Mysql远程登录及常用命令.doc UCenter 1.5.0 安装图文教程.doc UCenter Home 2.0 安装方法详细介绍.doc usrlocalliblibz.a could not read symbols Bad value问题解决(64 位 Linux)....
Linux下搭建PHP环境,本人博客上面有详细的配置步奏
Linux下部署php全过程,边操作边记录,按照文档操作部署成功
LINUX下APACHE+MYSQL+PHP运行环境搭建教程.pdf
最好的Linux 服务器环境搭建推荐教程 很详细噢,欢迎下载阅读
PHP LAMP环境搭建的所有问题及解决方案Linux .pdf
linux下apahce mysql php环境的搭建,centos 防火墙的开启与关闭, centos6下php版本的升级
Linux下LAMP PHP开发环境搭建.docx