1、Apache和PHP結(jié)合
配置httpd支持php
•httpd主配置文件/usr/local/apache2.4/conf/httpd.conf
•vim/usr/local/apache2.4/conf/httpd.conf//修改以下4個(gè)地方
ServerName
Requirealldenied
AddTypeapplication/x-httpd-php.php
DirectoryIndexindex.htmlindex.php
•/usr/local/apache2.4/bin/apachectl-t//測試語法
•/usr/local/apache2.4/bin/apachectlstart//啟動服務(wù)
•netstat-lntp
•curllocalhost
•vim/usr/local/apache2.4/htodcs/test.php//增加如下內(nèi)容
<?php
echo123;
?>
•curllocalhost/test.php
配置http支持PHP http的主配置文件為/usr/local/apache2.4/conf/httpd.conf這里需要修改配置文件中的4處,分別為:
ServerName
Requirealldenied
AddTypeapplication/x-httpd-php.php
DirectoryIndexindex.htmlindex.php
步驟:
修改ServerName
[root@centos001~]#/usr/local/apache2.4/bin/apachectlrestart AH00558:httpd:Couldnotreliablydeterminetheserver\'sfullyqualifieddomainname,usingfe80::20c:29ff:fe34:4a63.Setthe\'ServerName\'directivegloballytosuppressthismessage
解決方法:編輯這個(gè)文件,然后重啟就沒有了
進(jìn)入配置文件后搜索ServerName
#進(jìn)入配置文件 [root@centos001~]#vim/usr/local/apache2.4/conf/httpd.conf #搜索 /ServerName
錯誤1:視屏中遇到的錯誤,取消掉注釋后重啟服務(wù),還是有問題
新聞名稱:十周第二次課
本文地址:http://www.rwnh.cn/article26/cgjscg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、做網(wǎng)站、用戶體驗(yàn)、品牌網(wǎng)站設(shè)計(jì)、品牌網(wǎng)站建設(shè)、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)