【php】PHP環境整合

來源:互聯網
上載者:User

標籤:style   ext   color   http   c   strong   

很久沒裝環境, 今天重新裝了一次。遇到不少問題。記錄下方便以後查看

修改apache的設定檔httpd.conf

#apache 解析php
LoadFile "C:/phpeve/php52/libmysql.dll" 載入dll檔案。不用把檔案放入system32檔案夾下
LoadModule php5_module "C:/phpeve/php52/php5apache2_2.dll"
PHPIniDir "C:/phpeve/php52/php.ini" 指向php.ini的檔案目錄
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm

apache虛擬機器主機配置

NameVirtualHost *:80

<VirtualHost *:80>
#網站根目錄
    DocumentRoot "D:/WWW/"
    #綁定網域名稱
    ServerName www.xxx.net
    #配置錯誤頁面和錯誤記錄檔
    ErrorDocument 404 /missing.html
    ErrorLog "logs/www.xxxx.com-error.log"
</VirtualHost>
#配置網站目錄存取權限
<Directory "D:/WWW/">
    Options FollowSymLinks ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
#配置301重新導向
<VirtualHost *:80>
ServerName xxx.net
RedirectMatch permanent ^/(.*) http://www.xxx.net/$1
</VirtualHost>

php.ini的配置

配置ext的路徑。

extension_dir = "C:/phpeve/php52/ext/"

開啟對應的拓展庫

extension=php_bz2.dll
extension=php_curl.dll

extension=php_mysql.dll
extension=php_mysqli.dll

extension=php_mbstring.dll
extension=php_mcrypt.dll

extension=php_pdo.dll
extension=php_pdo_mysql.dll

設定時區

date.timezone =PRC

設定編碼

default_charset = "utf-8"

配置session

session.save_handler = files  session儲存方式 檔案

session.save_path = "c:/tmp" //session儲存路徑

session.name = PHPSESSID session name的名字

配置upload

file_uploads = On  允許檔案上傳

upload_tmp_dir ="c:/temp/"

upload_max_filesize = 2M 上傳檔案的大小

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.