CentOS6 5 獨立配置PHP 環境

2021-06-27 22:20:20 字數 2408 閱讀 5789

os:centos6.5(阿里雲官方)

webserver:nginx

./configure --prefix=/usr/local/php --with-mysql --with-mysql-sock --with-mysqli --enable-fpm --with-ncurses --enable-soap --with-libxml-dir --with-xmlrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --disable-mbregex --disable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-pdo-mysql --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-******xml --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear

其中阿里雲的映象centos 沒有 ncurses  xmlrpc sqlite3 這3個依賴 我直接把這3個依賴刪除了

1>.伺服器上html檔案可以訪問,php檔案無法訪問。

解決過程:

1. 修改 php-fpm.conf request_terminate_timeout=0; 沒用

2.nginx.conf 修改worker_connections 1024--5000 沒用

3.解決辦法就是修改配置檔案中的worker_connections值,將其調大。但是今天在本機的nginx中配置乙個proxy,完全沒有外界的訪問的情況也提示上述錯誤,試著修改worker_connections也沒有解決問題。文中是**回環。我沒有用apache。所以將apache-php部分注釋掉。保留php-fpm部分。問題解決。

2>.訪問php提示"file not found.",同時在錯誤日誌中看到:fastcgi sent in stderr: "primary script unknown" while reading response header from upstream

解決過程:

參考 在nginx配置檔案中找到定義呼叫指令碼檔案的地方:fastcgi_param  script_filename  /scripts$fastcgi_script_name;

改為:astcgi_param script_filename $document_root$fastcgi_script_name;

CentOS6 5配置網路

1 兩塊網絡卡的說明 第一塊網絡卡為配置外網 eth0 第二塊網絡卡為配置內網 eth1 沒有外網的機器也要將內網配置在第二塊網絡卡上 1 安裝完畢後預設配置 centos 6.5預設安裝好之後是沒有自己主動開啟網路連線的!2 預設ip圖 3 預設網絡卡1配置檔案。檔案路徑 etc sysconfi...

Centos6 5配置網路

安裝centos6.5之後,需要重新配置網路 device eth0 網絡卡對應的裝置別名 hwaddr 00 0c 29 d7 86 78 網絡卡mac位址 type ethernet uuid 3e3f6644 b67a 473b 91a3 2fa0a2018bf8 uuid含義是通用唯一識別碼...

centos6 5配置靜態ip

1.先檢視當前虛擬機器的閘道器,如下圖所示,destination全是0的,方框中是需要的閘道器 2.更改ifcfg eth0檔案中的配置 root centos vi etc sysconfig network scripts ifcfg eth0更改後如下所示,最後3項是需要手動更改的,其中最後...