Apache PHP mysql Environment configuration
The first time to build Apache PHP MySQL environment, encountered some problems. Use the following version:
Apache version: 2.2.17 installation location: C:\Program Files\apache software foundation\apache2.2
PHP Version: 5.3.9 installation location: C:\php
MySQL version: 5.5 Installation location: C:\Program Files\mysql
Operating system: Windows XP
According to some of the online tutorials, the following changes have been made:
Modify the Apache server configuration file httpd.conf
Web root directory: DocumentRoot "C:/Program Files/apache software Foundation/apache2.2/htdocs"
Catalog Index:D irectoryindex index.html index.php
Modify PHP config file php.ini (in PHP installed directory there are two files, "Php.ini-development" and "Php.ini-production" I Modified "php.ini-production" as PHP.ini)
Open global variable: register_globals = On
Load Module Location: Extension_dir = "C:/php/ext"
Load module: Extension=php_mysql.dll
Extension=php_mysql.dll
"Environment variable"--"system variable"-"Path" added "; C:\php; C:\php\ext ";
Combine PHP with Apache in module mode to modify http.conf
Add line LoadModule php5_module C:/php/php5apache2_2.dll
Phpinidir "c:/php"
AddType application/x-httpd-php. php
The code to run is as follows:
$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);
?>
The result is a blank, without prompting for any information, or outputting the contents of the database store.
Why do you ask the great God? Thank you for your guidance!
------Solution--------------------
5.3.9 has no V6 version, so you can refer to the Online module installation method is no longer appropriate.
1. You can use the older version, there is no problem for the development environment.
Http://windows.php.net/downloads/releases/archives/php-5.3.5-Win32-VC6-x86.msi
2. Or install into a fastcgi mode
You can refer to other people's installation experience
http://www.laokboke.net/2011/12/02/bind-fastcgi-and-apache-on-windows/
3. Of course you can also come here to compile the V6 version of others, here may be some enthusiasts? I don't know if this release is some enthusiast
http://www.apachelounge.com/download/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.