centos7編譯php(centos7怎麼編程)

本文目錄一覽:

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 induces 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 induces 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 induces 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 induces 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 induces 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 induces 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 induces 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= –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)

求助,centos7編譯源碼php時載入庫的問題

php-fpm參數:

–start 啟動

–stop 強制終止

–quit 平滑終止

–restart 重啟

–reload 重新平滑載入php的php.ini

–logrotate 重新啟用log文件

原創文章,作者:WXOEM,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/316736.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
WXOEM的頭像WXOEM
上一篇 2025-01-09 12:14
下一篇 2025-01-09 12:14

相關推薦

  • PHP和Python哪個好找工作?

    PHP和Python都是非常流行的編程語言,它們被廣泛應用於不同領域的開發中。但是,在考慮擇業方向的時候,很多人都會有一個問題:PHP和Python哪個好找工作?這篇文章將從多個方…

    編程 2025-04-29
  • PHP怎麼接幣

    想要在自己的網站或應用中接受比特幣等加密貨幣的支付,就需要對該加密貨幣擁有一定的了解,並使用對應的API進行開發。本文將從多個方面詳細闡述如何使用PHP接受加密貨幣的支付。 一、環…

    編程 2025-04-29
  • 使用PHP foreach遍歷有相同屬性的值

    本篇文章將介紹如何使用PHP foreach遍歷具有相同屬性的值,並給出相應的代碼示例。 一、基礎概念 在講解如何使用PHP foreach遍歷有相同屬性的值之前,我們需要先了解幾…

    編程 2025-04-28
  • PHP獲取301跳轉後的地址

    本文將為大家介紹如何使用PHP獲取301跳轉後的地址。301重定向是什麼呢?當我們訪問一個網頁A,但是它已經被遷移到了另一個地址B,此時若伺服器端做了301重定向,那麼你的瀏覽器在…

    編程 2025-04-27
  • PHP登錄頁面代碼實現

    本文將從多個方面詳細闡述如何使用PHP編寫一個簡單的登錄頁面。 1. PHP登錄頁面基本架構 在PHP登錄頁面中,需要包含HTML表單,用戶在表單中輸入賬號密碼等信息,提交表單後服…

    編程 2025-04-27
  • PHP與Python的比較

    本文將會對PHP與Python進行比較和對比分析,包括語法特性、優缺點等方面。幫助讀者更好地理解和使用這兩種語言。 一、語法特性 PHP語法特性: <?php // 簡單的P…

    編程 2025-04-27
  • PHP版本管理工具phpenv詳解

    在PHP項目開發過程中,我們可能需要用到不同版本的PHP環境來試驗不同的功能或避免不同版本的兼容性問題。或者我們需要在同一台伺服器上同時運行多個不同版本的PHP語言。但是每次手動安…

    編程 2025-04-24
  • PHP數組去重詳解

    一、array_unique函數 array_unique是php中常用的數組去重函數,它基於值來判斷元素是否重複,具體使用方法如下: $array = array(‘a’, ‘b…

    編程 2025-04-24
  • PHP導出Excel文件

    一、PHP導出Excel文件列寬調整 當我們使用PHP導出Excel文件時,有時需要調整單元格的列寬。可以使用PHPExcel類庫中的setWidth方法來設置單元格的列寬。下面是…

    編程 2025-04-24
  • php擴展庫初探

    一、什麼是php擴展庫? PHP擴展庫(PHP extension)是一些用C語言編寫的動態鏈接庫,用於擴展PHP的功能。PHP擴展庫使得PHP可以與各種資料庫系統相連、SMTP、…

    編程 2025-04-23

發表回復

登錄後才能評論