作为一名php程序员,最好还是学会自己搭开发环境,这样才能知道哪些模块是自己需要的,出了问题到底应该怎么解决,今天把自己搭的一个环境整理了一下,大致修改都有了,有兴趣的朋友可以看看。还有一些其他版本的,有时间整理了,在分享吧,呵呵!
配置好的环境已经放到百度网盘
大致过程如下,希望能帮到一些朋友
win7(32)-apache2.2.9-mysql5.5.25-php5.3.28
将MyServer.zip解压到E盘根目录,自己手动安装服务
一、配置环境
操作系统:win7 32位
php版本:php-5.3.28(32位)
apache版本:httpd-2.2.9(32位)
mysql版本:mysql-5.5.25
二、配置文件修改
httpd.conf修改
ServerRoot “E:/MyServer/apache2.2”
Listen 9090
PHPIniDir “E:/MyServer/php5.3.28”
LoadFile “E:/MyServer/php5.3.28/ssleay32.dll”
LoadFile “E:/MyServer/php5.3.28/libeay32.dll”
LoadFile “E:/MyServer/mysql5.5/lib/libmysql.dll”
LoadModule php5_module “E:/MyServer/php5.3.28/php5apache2_2.dll”
ServerName localhost:9090
DocumentRoot “E:/MyServer/apache2.2/htdocs”
NameVirtualHost *:9090
Include “conf/vhosts/*.conf”
test.conf
<VirtualHost *:9090>
DocumentRoot “E:\MyServer\www\test”
ServerName www.test.com
<Directory />
Options Indexes FollowSymLinks
DirectoryIndex index.html index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</VirtualHost>
php.ini修改
short_open_tag = On
display_errors = On
extension_dir = “E:\MyServer\php5.3.28\ext\”
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
extension=php_soap.dll
extension=php_sockets.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
[memcache]
extension=php_memcache.dll
my.ini修改
basedir=”E:/MyServer/mysql5.5/”
datadir=”E:/MyServer/mysql5.5/data/”
把E:\MyServer\php5.3.28\php5ts.dll拷贝到E:\MyServer\apache2.2\bin这个目录下面
重启apache
host修改(用于虚拟主机通过域名本地访问)
用文本编辑工具打开C:\Windows\System32\drivers\etc\hosts
本地host增加一行记录
127.0.0.1 www.test.com
数据库
E:\MyServer\mysql5.5\bin>mysqladmin -u root -p password 54xiake.cn
账号root密码54xiake.cn
三、安装|卸载服务(以管理员身份运行cmd.exe)
C:\Windows\System32\cmd.exe
安装|启动服务
E:\MyServer\apache2.2\bin\httpd.exe -k install -n Apache2.2 -f “E:\MyServer\apache2.2\conf\httpd.conf”
net start Apache2.2
E:\MyServer\mysql5.5\bin\mysqld.exe –install MySQL5.5 –defaults-file=”E:\MyServer\mysql5.5\my.ini”
net start MySQL5.5
停止|卸载服务
net stop Apache2.2
sc delete Apache2.2
net stop MySQL5.5
sc delete MySQL5.5
E:\MyServer\mysql5.5\bin\mysqld.exe -remove MySQL5.5
四、问题解决
1、PHP Warning: PHP Startup: Unable to load dynamic library ‘E:\\MyServer\\php5.3.28\\ext\\php_curl.dll’ – \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0
解决方法:
LoadFile “E:/MyServer/php5.3.28/ssleay32.dll”
LoadFile “E:/MyServer/php5.3.28/libeay32.dll”
五、访问测试
phpinfo
http://www.test.com:9090/p.php
php探针
http://www.test.com:9090/tz.php
系统测试(Piwik: 开放源代码的Web统计软件)
http://www.test.com:9090/piwik
账号:admin 密码:123456
有任何问题,请留言,好了,就这么多了,期待下回分享吧!