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 就好了呀,不過真看不出還需要啥 了...俺不搞開發...
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)