Heim  >  Artikel  >  Backend-Entwicklung  >  Apache+PHP+Mysql 配置

Apache+PHP+Mysql 配置

WBOY
WBOYOriginal
2016-07-29 09:14:41849Durchsuche

环境配置完毕,中途遇到了问题,备份解决方案。

原料:

Apache service Monitor

PHP 5.2

Mysql 5.5

以上全部安装

一、配置Apache 

    首先修改Apache的配置文件。Apache配置文件在Apache安装目录的conf目录下的httpd.conf。

    1、让Apache解析php文件

    在配置文件中找到 #LoadModule vhost_alias_module modules/mod_vhost_alias.so 在一行添加

    LoadModule php5_module "D:/WebServer/php/php5Apache2_2.dll" 

    AddType application/x-httpd-php .php

    PHPIniDir "D:/WebServer/php"

    2、配置起始页

    DirectoryIndex index.html 改为 DirectoryIndex index.php index.html

    3、修改Apache站点目,项目存放的空间

    DocumentRoot "D:/Develop/Apache2.2/htdocs":网站存放网页的位置,与IIS中的"主目录"一样改为

    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/test"

   Apache2.2/htdocs">:对主站点的目录进行访问控制,改为
    Apache Software Foundation/Apache2.2/htdocs/www.lizhonghongyun.com"> 

二、配置PHP

    php.ini-development改名为php.ini
    修改php.ini
    extension_dir = "ext" 改为 extension_dir = "D:/WebServer/php/ext";
    以下项去;号
    ;extension=php_curl.dll
    ;extension=php_gd2.dll
    ;extension=php_mbstring.dll
    ;extension=php_mysql.dll
    ;extension=php_xmlrpc.dll
    修改日期
    ;date.timezone =改为date.timezone = Asia/Shanghai

三、php开启curl扩展的方法

    1、将PHP文件夹下的三个文件php_curl.dll,libeay32.dll,ssleay32.dll复制到system32下;
    2、将php.ini(c:WINDOWS目录下)中的;extension=php_curl.dll中的分号去掉;
    3、重启Apache或者IIS。


四、无法加载php_mcrypt.dll、php_mysql.dll

    解决方法将libmcrypt.dll,libmysql.dll复制到system32下;

以上就介绍了Apache+PHP+Mysql 配置,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn