导航:首页 > 编程语言 > centos重新编译php

centos重新编译php

发布时间:2022-05-24 10:57:24

㈠ 求助,centos7编译源码php时加载库的问题

php-fpm参数:

--start 启动
--stop 强制终止
--quit 平滑终止
--restart 重启
--reload 重新平滑加载php的php.ini
--logrotate 重新启用log文件

㈡ Centos更新PHP版本问题

直接编译安装新版的php,目录名跟旧的不重名就行。

然后指定某些软链接到新的目录下,配置信息php.ini,需要手动筛选移植。不过也可以尝试直接覆盖

㈢ 关于CENTOS上编译安装PHP5的问题,求教

Centos编译安装PHP 5.5笔记
Written by 一像素 on 2013年十月25日
本篇是在 Centos 6.4 32bit 下编译安装 php 5.5.5 的笔记,接上篇 Centos编译安装Apache 2.4.6笔记。php 5.5.x 和 centos 源里面的 php 5.3.x 之间的性能差异见升级到 PHP 5.5.x + opcache。
首先是编译准备工作:
yum groupinstall "Development tools"

然后是编译安装 PHP 5.5.x 需要用到的 devel 包:
yum install libxml2-devel gd-devel libmcrypt-devel libcurl-devel openssl-devel

从官方下载,解压
wget http://us3.php.net/get/php-5.5.5.tar.gz/from/cn2.php.net/mirror
tar -xvf php-5.5.5.tar.gz
cd php-5.5.5

编译安装 php 5.5 的参数:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --disable-cli --enable-shared --with-libxml-dir --with-gd --with-openssl --enable-mbstring --with-mcrypt --with-mysqli --with-mysql --enable-opcache --enable-mysqlnd --enable-zip --with-zlib-dir --with-pdo-mysql --with-jpeg-dir --with-freetype-dir --with-curl --without-pdo-sqlite --without-sqlite3
我已经尽量的在参数上做了精简,用以上参数编译安装好的 php 运行 wordpress, joomla, ip board 等常见的博客、论坛程序都是没有问题的,因为有了 --disable-cli,所以就没法 make test 了,安装好以后也没法 php -v 了。安装吧:
make
make install
cp php.ini-proction /usr/local/lib/php.ini
#记住上面 php.ini 的位置哦。

是时候让 apache 知道有 php 的存在了,在 apache 配置文件 httpd.conf 中添加:
LoadMole php5_mole moles/libphp5.so
#上面那行可能在编译安装 php 的过程中已经由系统自动添加了
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

OK!重启 apache,人品好的人是不会出现问题的。
Tags: LAMP
Comments
# jieweiwo 2015-08-26 19:20
为啥我编译安装之后没有bin目 录 控制台无法执行
Reply
# 一像素 2015-08-26 19:53
编译参数里面的 --disable-cli 去掉。
Reply
# jieweiwo 2015-08-26 23:37
非常感谢你的教程!那这个编译安 装的php是不是就能应付一般的 的开发了 没有安装的特性以后需要怎么办?
Reply
# 一像素 2015-08-26 23:40
需要什么再 --enable-xxx 就好了呀,不过真看不出还需要啥 了...俺不搞开发...

linux centos 怎么安装 php编程 软件

Gettext
1 首先进入到php源码包中
cd /opt/php-5.1.2/ext/gettext
2 在gettext文件夹下产生configure文件
/opt/php/bin/phpize
3 配置编译
./configure --with-php-config=/opt/php/bin/php-config --with-gettext
make && make install
4 在/opt/php/lib/php/extensions下产生一个gettext.so文件
5 确定 php.ini文件中的extension_dir=/opt/php/lib/php/extensions 跟 extension=gettext.so
6 重新编译 php
Zlib
1 首先进入到php源码包中
cd /opt/php-5.1.2/ext/zlib
2 在zlib文件夹下产生configure文件
/opt/php/bin/phpize
3 配置编译
./configure --with-php-config=/opt/php/bin/php-config --with-zlib
make && make install
4 在/opt/php/lib/php/extensions下产生一个zlib.so文件
5 确定 php.ini文件中的extension_dir=/opt/php/lib/php/extensions 跟 extension=zlib.so
6 重新编译 php
mbString
配制mbstring扩展
1 运行 /opt/php/bin/phpize
2 进入到 php源码包中的ext/mbstring下
cd /opt/php-5.1.2/ext/mbstring
./configure --with-php-config=/opt/php/bin/php-config --enable-mbstring
make && make install
3 这样就在/opt/php/lib/php/extensions下生成一个mbstring.so
4然后保证extension_dir指向正确的位置,extension=php_mbstring.dll开启
这样mbstring就开启了
Mod_rewrite
以RHEL5为例
1)首次安装apache,在编译时增加--enable-rewrite选项。
如./configure --prefix=/usr/local/apachel --enable-so --enable-mods-shared=all --enable-rewrite --enable-cache
2)增加mod_rewrite模块
# find mod_rewrite.c //在apache的源码安装目录中寻找mod_rewrite.c文件
一般会在httpd-2.28/moles/mappers下
# /opt/httpd/bin/apxs -c mod_rewrite.c //apxs应指定绝对路径,在你当前正在使用apache的bin目录里
# /opt/httpd/bin/apxs -i -a -n mod_rewrite mod_rewrite.la
如果没有什么错误的话,应该在你的apache的moles目录中编译出一个mod_rewrite.so文件。
编辑httpd.conf文件,确认httpd.conf中已经包含mod_rewrite.so的加载语句,如下:
LoadMole rewrite_mole moles/mod_rewrite.so
这时,你的apache应该已经支持rewrite了。
重启apache即可。

㈤ 如何重新编译一下PHP

whereis mysql

ps aux | grep mysql (这是看mysql的进程,看他的进程是在那启的有时候可以找到安装的目录)

实在不行切换到root下,# find / -name mysqld

如果你是想删除mysql重新装的话就
# rpm -qa | grep mysql

mod_auth_mysql-2.6.1-2.2
php-mysql-5.3.9-3.15
mysql-devel-5.1.77-1.CenOS 5.2

mysql-5.0.77-1.CenOS 5.2
mysqlclient10-5.0.77-1.CentOS 5.2
libdbi-dbd-mysql-0.6.5-10.CentOS 5.2

# rpm -e mysqlclient

或者
# yum -y remove mysql

㈥ centos7 怎么编译安装php

html+css是很基础的.这个呢.先学会用即可.慢慢的就树立了.用php找工作的基础是:1.会做企业网站.如新闻系统,产品系统,上传图片等.基本熟练后,工资在1800-3000左右.2.能开发一定功能的系统.如客户系统,能使用框架.如zend.thinkphp.如果熟练.工作在5000左右.3.能进行二次开发,熟悉各种框架和开源系统.有深度的理解.工资在6000以上.学会第一个阶段.需要用1个月左右.其他的就看你的天赋了.

楼主看懂了吗?如果还不懂就去后盾人那自学吧,里面有很多好东西教学质量也不错最近还听说他们在搞实训班培训的活动

㈦ Centos7下编译php5.6.19出错,怎么解决

第一次编译安装PHP的时候很顺利,因为要增加freetype,所以要重新编译,结果死活就是无法通过configure。
1. centos7信息
2. 运行 ./configure 报错
3. 运行 grep error config.log
4. 按照网上说的方法 在configure后面加上了 --host=x86_64 ,报错
5. config.log中错误提示,差好几个头文件
6. gcc安装信息
下次那你还有什么不懂的你就去后盾人看看,那里的教学视频有很多,我就是在那里学会的

㈧ CentOS6.8下编译安装PHP,执行 /configure后报错,请问怎么解决

一般报错就2种:
1、没有gcc
错误:configure: error: no acceptable C compiler found in $PATH
解决办法:安装gcc g++
2、缺乏依赖包
错误:configure: error: No curses/termcap library found
解决办法:yum -y install ncurses-devel

错误:configure: error: xml2-config not found. Please check your libxml2 installation.
解决办法:yum -y install libxml2 libxml2-devel

㈨ centos7编译php出现问题 系统:CENTOS7 64位 PHP版本:7.1.0 APACHE版本:2.4.25 MYSQL版

1、php的编译问题主要是依赖包没有提前安装
2、如果依赖mysql,就先安装mysql-devel或编译mysql
3、需要提前安装的有,不能写太细,太细会被度娘屏蔽:
yasm-1.3.0.tar.gz
libmcrypt-2.5.8.tar.gz
libvpx-v1.3.0.tar.bz2
tiff-4.0.3.tar.gz
libpng-1.6.16.tar
freetype-2.5.4.tar.gz
jpegsrc.v9a.tar.gz
libgd-2.2.3.tar.gz
t1lib-5.1.2.tar.gz
4、安装编译php
5、安装php后有一些优化包根据需要安装

㈩ centos7编译php5.4.38时出错

1. centos7信息

uname -a

Linux dev 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

2. 运行 ./configure 报错

configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
3. 运行 grep error config.log

cc: error: unrecognized command line option '-V'
cc: fatal error: no input files
cc: error: unrecognized command line option '-qversion'
cc: fatal error: no input files
conftest.c:9:19: fatal error: stdio.h: No such file or directory
configure:4076: error: in `/usr/local/src/php-5.6.19':
configure:4078: error: cannot run C compiled programs.

4. 按照网上说的方法 在configure后面加上了 --host=x86_64 ,报错
configure: error: in `/usr/local/src/php-5.6.19':
configure: error: C preprocessor "/lib/cpp" fails sanity check
5. config.log中错误提示,差好几个头文件

cc: error: unrecognized command line option '-V'
cc: fatal error: no input files
cc: error: unrecognized command line option '-qversion'
cc: fatal error: no input files
conftest.c:9:19: fatal error: stdio.h: No such file or directory
configure:4076: error: in `/usr/local/src/php-5.6.19':
configure:4078: error: cannot run C compiled programs.
[root@dev php-5.6.19]# grep error config.log
cc: error: unrecognized command line option '-V'
cc: fatal error: no input files
cc: error: unrecognized command line option '-qversion'
cc: fatal error: no input files
conftest.c:9:19: fatal error: stdio.h: No such file or directory
conftest.c:9:20: fatal error: stdarg.h: No such file or directory
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following inces an error, until -std is added to get
cc: error: unrecognized command line option '-qlanglvl=extc89'
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following inces an error, until -std is added to get
cc: error: unrecognized command line option '-qlanglvl=ansi'
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following inces an error, until -std is added to get
cc: error: unrecognized command line option '-std'
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following inces an error, until -std is added to get
<command-line>:0:1: error: missing '(' after predicate
conftest.c:9:20: fatal error: stdarg.h: No such file or directory
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following inces an error, until -std is added to get
<command-line>:0:1: error: missing '(' after predicate
conftest.c:9:20: fatal error: stdarg.h: No such file or directory
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following inces an error, until -std is added to get
cc: error: unrecognized command line option '-Xc'
| These don't provoke an error unfortunately, instead are silently treated
| as 'x'. The following inces an error, until -std is added to get
conftest.c:10:21: fatal error: limits.h: No such file or directory
| Syntax error
conftest.c:10:21: fatal error: limits.h: No such file or directory
| Syntax error
conftest.c:12:0: fatal error: assert.h: No such file or directory
| Syntax error
conftest.c:12:0: fatal error: assert.h: No such file or directory
| Syntax error
conftest.c:10:21: fatal error: limits.h: No such file or directory
| Syntax error
conftest.c:10:21: fatal error: limits.h: No such file or directory
| Syntax error
conftest.c:10:21: fatal error: limits.h: No such file or directory
| Syntax error
conftest.c:10:21: fatal error: limits.h: No such file or directory
| Syntax error
configure:4478: error: in `/usr/local/src/php-5.6.19':
configure:4480: error: C preprocessor "/lib/cpp" fails sanity check

6. gcc安装信息

[root@dev php-5.6.19]# rpm -qa | grep glibc
compat-glibc-headers-2.12-4.el7.centos.x86_64
glibc-utils-2.17-106.el7_2.4.x86_64
glibc-common-2.17-106.el7_2.4.x86_64
glibc-devel-2.17-106.el7_2.4.x86_64
glibc-static-2.17-106.el7_2.4.x86_64
glibc-2.17-106.el7_2.4.x86_64
glibc-headers-2.17-106.el7_2.4.x86_64
compat-glibc-2.12-4.el7.centos.x86_64

[root@dev php-5.6.19]# gcc -v
Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)

阅读全文

与centos重新编译php相关的资料

热点内容
无线路由如何设置成服务器 浏览:136
QQ飞车源码更新 浏览:897
虚拟机中编译器 浏览:474
台达PLC编译按钮在哪里 浏览:137
非编程计算器多少钱 浏览:653
房本还完贷款解压 浏览:816
中国程序员有出名吗 浏览:546
亳州云服务器 浏览:630
程序员最难的面试 浏览:892
配音秀app怎么诵读 浏览:751
sparkcore源码 浏览:100
程序员中年生活 浏览:355
读取加密信息失败怎么回事 浏览:510
编译过程之后是预处理吗 浏览:351
安卓是基于什么做出来 浏览:600
视频字幕提取APP怎么使用 浏览:59
js通过ip地址连接服务器吗 浏览:848
java数字金额大写金额 浏览:858
人人影视路由器固件编译 浏览:967
照片通讯录短信怎么从安卓到苹果 浏览:458