apache php mysql的环境配置,该如何解决

WBOY
Release: 2016-06-13 10:07:52
Original
722 people have browsed it

apache php mysql的环境配置
第一次搭建apache php mysql的环境,遇到了些问题。用到版本如下:
apache 版本:2.2.17 安装位置:C:\Program Files\Apache Software Foundation\Apache2.2
php版本:5.3.9 安装位置:C:\php
mysql版本:5.5 安装位置:C:\Program Files\MySQL
操作系统:windows xp

根据网上看的一些教程,做了如下修改:
修改Apache服务器的配置文件httpd.conf
网站根目录:DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
目录索引 :DirectoryIndex index.html index.php
 
修改php的配置文件php.ini(在php安装的目录下有两个文件,“php.ini-development”和“php.ini-production”我修改的“php.ini-production”作为php.ini)
打开全局变量:register_globals = On
加载模块位置:extension_dir = "C:/php/ext"
加载模块:extension=php_mysql.dll
  extension=php_mysql.dll
“环境变量”——“系统变量”——“Path”加入了“;C:\php;C:\php\ext”;

将php以module方式与Apache相结合,修改http.conf
增加行 LoadModule php5_module C:/php/php5apache2_2.dll
  PHPIniDir "C:/php"
  AddType application/x-httpd-php .php

运行的代码如下:
    $conn = mysql_connect("localhost", "root", "901030");
  mysql_select_db(curriculum,$conn);
  mysql_query("set names 'utf8'");
   
  $sql="select * from computer_science";
  $result=mysql_query($result,$conn);
   
  $row= mysql_fetch_row($result);
  print_r($row);
  ?>
结果是一片空白,没有提示任何信息,也没有输出数据库存储的内容。
请教各位大神这是什么原因呢?谢谢指导!

------解决方案--------------------
5.3.9 已经没有v6版本了 所以你参照网上所说的模块安装方法已经不再合适了。

1.你可以使用旧一点的版本,对于开发环境来说是没有任何问题的。
http://windows.php.net/downloads/releases/archives/php-5.3.5-Win32-VC6-x86.msi

2.或者安装成fastCGI的方式
你可以参考别人的安装经验
http://www.laokboke.net/2011/12/02/bind-fastcgi-and-apache-on-windows/

3.当然你也可以到这里下别人编译好的v6版本,这里可能是一些爱好者?我没有了解这个发行是不是一些爱好者
http://www.apachelounge.com/download/

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!