本文目錄一覽:
- 1、PHP安裝出錯
- 2、安裝php軟體時提示這樣的錯誤:error trying access httpd.conf file,要求配置伺服器,是什麼意思?
- 3、php程序安裝打開出現內容編碼錯誤
- 4、linux 下安裝完php出現錯誤
- 5、編譯安裝php時出錯configure: error: build test failed.
PHP安裝出錯
我怎麼覺得你那兩行是我機器上的配置,我的php、mysql、apache都是安裝在e:\的,而且都各自安裝了多種版本。
你要找到你機器上的php5apache2_2.dll的位置,替換為指定的路徑即可。
另外,你現在究竟遇到了什麼問題,你說的沒解決是什麼意思???
PHP報這個錯不用管,安裝是算完成了的,只要手工修改httpd.conf後Apache就能正常工作,不工作你要說現象,最好拷貝個屏幕貼一下。
安裝php軟體時提示這樣的錯誤:error trying access httpd.conf file,要求配置伺服器,是什麼意思?
不知道你怎麼做的。我簡單說下,php+Apache。
1.下載Apache和php,Apache是msi的,直接下一步下一步安裝就好了。
安全完Apache,打開 ,成功的話可以看到 It works。
2.解壓開php之後,打開Apache的配置文件 httpd.conf
2.1在LoadModule塊結尾加上:
LoadModule php5_module D:/php5/php5apache2_2.dll
#假設你的php解壓到了 D:/php5
2.2找到 DirectoryIndex 在後面加上 index.php,一般會讓它放在第一個,這個引導頁面是有順序的,舉例:
DirectoryIndex index.php index.html
2.3找到 mime_module 塊 在裡面結尾加上一句:
AddType application/x-httpd-php .php .phtml
#後綴名可以自己隨便加,一般會用.php
2.4在文件的結尾 還可以加上一句:
PHPIniDir “D:/php5”
#這個是定義 php.ini 文件的。 如果沒有這一句,Apache找不到php的配置,當然你可以把 php.ini 複製到C:/Windows 裡面也可以,在環境變數的Path里加上 “D:/php5” 也是可以的。
3.去php目錄,把 php.ini-production 或者 php.ini-development 複製一份,然後改名為 php.ini。進去編輯。載入自己需要的dll,還有ext的路徑要設置一下,當然把 D:/php5/ext 寫著環境變數的 Path也可以。
事實上沒有第3步也可以運行php了,你可以去Apache設置的 DocumentRoot 下創建一個 index.php ,裡面寫著:
?php
phpinfo();
用 進去看看。
就可以查看到php的相關信息了。
php程序安裝打開出現內容編碼錯誤
親,很高興為你解答:
這可能是與伺服器的全局配置有關:
1、伺服器不支持這種壓縮格式,可使用function_exists(‘ob_gzhandler’)判斷,解決方法 ob_start(‘ob_gzhandler’)改為ob_start();
2、使用ob_start(‘ob_gzhandler’)時候前面已經有內容輸出,檢查前面內容以及require include調用文件的內容。若無法找到可以在調用其它文件前使用ob_start(),調用之後使用 ob_end_clean () 來清除輸出的內容;
也有可能是文件中包含了BOM頭,你可以用以下程序檢查:
?php
if (isset($_GET[‘dir’])){ //設置文件目錄
$basedir=$_GET[‘dir’];
}else{
$basedir = ‘.’;
}
$auto = 1;
checkdir($basedir);
function checkdir($basedir){
if ($dh = opendir($basedir)) {
while (($file = readdir($dh)) !== false) {
if ($file != ‘.’ $file != ‘..’){
if (!is_dir($basedir.”/”.$file)) {
echo “filename: $basedir/$file “.checkBOM(“$basedir/$file”).” br”;
}else{
$dirname = $basedir.”/”.$file;
checkdir($dirname);
}
}
}
closedir($dh);
}
}
function checkBOM ($filename) {
global $auto;
$contents = file_get_contents($filename);
$charset[1] = substr($contents, 0, 1);
$charset[2] = substr($contents, 1, 1);
$charset[3] = substr($contents, 2, 1);
if (ord($charset[1]) == 239 ord($charset[2]) == 187 ord($charset[3]) == 191) {
if ($auto == 1) {
$rest = substr($contents, 3);
rewrite ($filename, $rest);
return (“font color=redBOM found, automatically removed./font”);
} else {
return (“font color=redBOM found./font”);
}
}
else return (“BOM Not Found.”);
}
function rewrite ($filename, $data) {
$filenum = fopen($filename, “w”);
flock($filenum, LOCK_EX);
fwrite($filenum, $data);
fclose($filenum);
}
?
運行後看一下程序輸出就可以了,有BOM頭的會有紅字提示。
———————————–
如有疑問歡迎追問!
滿意請點擊右上方【選為滿意回答】按鈕 么么噠o(∩_∩)o
linux 下安裝完php出現錯誤
這個不是報錯。查看版本命令你少了一個空格,要在php後面加個空格
編譯安裝php時出錯configure: error: build test failed.
對於PHP在./configure的時候出現下面問題:
checking whether to enable LIBXML support… yes
checking libxml2 install dir… /usr/local/libxml2/
checking for xml2-config path… /usr/local/libxml2//bin/xml2-config
checking whether libxml build works… no
configure: error: build test failed. Please check the config.log for details.
#按照提示我們查看php安裝目錄下的config.log文件,搜索xml2-config
[root@lamp-lnmp php-5.6.40]# vim config.log
#發現下面內容:
configure:23104: checking for xml2-config path
configure:23118: result: /usr/local/libxml2//bin/xml2-config
configure:23262: checking whether libxml build works
configure:23289: cc -o conftest -g -O2 -fvisibility=hidden -pthread -D_REENTRANT -Wl,-rpath,/usr/local/libxml2/lib -L/usr/local/libxml2/lib conftest.c
-lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl 5
configure:23289: $? = 0
configure:23289: ./conftest
./conftest: /lib64/libz.so.1: version `ZLIB_1.2.3.3′ not found (required by /usr/local/libxml2/lib/libxml2.so.2)
configure:23289: $? = 1
configure: program exited with status 1
configure: failed program was:
#我們這裡查看一下這個/lib64/libz.so.1的文件,發現鏈接到一個舊的libz文件中,這裡將/lib64/libz.so.1軟連接到新文件/usr/local/lib/libz.so.1.2.11中進行下面設置。
[root@lamp-lnmp ~]# ln -sf /usr/local/lib/libz.so.1.2.11 /lib64/libz.so.1
[root@lamp-lnmp ~]# ls -l /lib64/libz.so.1
lrwxrwxrwx 1 root root 29 Feb 2 11:13 /lib64/libz.so.1 – /usr/local/lib/libz.so.1.2.11
原創文章,作者:XWPQ,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/147867.html