Apache+php+MySql手动配置
备忘一下
备忘一下:一. Apacha2.2 修改 httpd.conf, 添加以下配置:#PHP配置LoadModule php5_module "D:/PHP5.4/php5apache2_2.dll"AddHandler application/x-httpd-php .php# 配置 php.ini 的路径PHPIniDir "D:/PHP5.4" #修改一下配置,让apache优先转发php请求 <IfModule dir_module> DirectoryIndex index.php index.html </IfModule>二。php的配置复制 php.ini-production,并重命名为 php.ini添加D:/PHP5.4 到环境变量的path中。去掉以下dll的注释:extension=php_gd2.dllextension=php_mbstring.dllextension=php_mysql.dll extension=php_pdo_mysql.dll //drupal需要这个 其它配置:时区: [Date] date.timezone = Asia/Shanghai 会话: [Session] session.save_path = "D:/PHP5.4/tmp" 动态链接库目录: extension_dir = "ext"三.解压zip文件,安装最简单的来。复制my-small.ini,重命名为 my.ini添加D:/MySQL/bin的位置到环境变量的path中。在[mysqld]里面,添加以下几行配置:basedir="D:/MySQL"datadir="D:/MySQL/data" character-set-server=utf8//安装MySQL为服务(要求cmd以管理员身份运行)c:\>mysqld --install MySQL --defaults-file="D:/MySQL/my.ini" //启动服务c:\> net start MySQL//更改mysql的用户密码// root 初始密码为空c:\> mysql -u root -p#登录mysql>use mysql>update user set password=password("new_pass") where user="userName"; #userName换成你要修改的用户名的密码,比如root>flush privileges;>exit;四、关于链接的静态化:1)开启apache 的mod_rewrite模块,去掉注释:LoadModule rewrite_module modules/mod_rewrite.so2)修改 AllowOverride选项<Directory "E:/workspace_shawn/CMS"> # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All</Directory>3)在wordpress里面,选一个静态链接的选项,系统会在wordpress的根目录生成一个.htaccess文件。搞定!4)因为我本机的目录CMS,并不是wordpress的更目录,所以.htaccess其实访问不到。只有手动copy内容到 httpd.conf里面啦。呵呵。<VirtualHost shawn.tianya.cn:1234> DocumentRoot "E:\workspace_shawn\CMS" ServerName shawn1234 <IfModule rewrite_module.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] </IfModule></VirtualHost>