windows Apache+php+mysql+gd 要点

windows Apache+php+mysql+gd 要点

what is php?
PHPabbr. 个人网页(Personal Home Page);服务器端编程语言

引用www.apache.com的原文如下:

If you’re looking for a good developmental server for your work, or just for personal use, what better place than your workstation? It eliminates the need for uploading your work to a remote server and allows you to run your scripts and test your website in a server environment. You can even set it up to be accessible to world, password protected, or invisible behind your firewall.  Nowadays, it is easier than ever to get a complete web server setup on Windows. WAMP is a popular package combining the popular web server Apache, MySQL Database server, and PHP scripting language. The install takes a few minutes and is super easy; if you can click Next, you’re good. With a couple quick tweaks to your router and httpd.conf file you are ready to serve files to the web. The below steps will get you up and running in minutes, let’s get started!
所以推荐大家直接下载 WAMP 安装即可,省事,简便,快捷,呵呵
WAMP是指在Windows服务器上使用Apache、MySQL和PHP的集成安装环境,可以快速安装配置Web服务器,是四个名词首字母的缩写。

Apache

安装时候如果没有选择all user  80端口的话,在win系统中可能找不到HTTP的服务.

配置文件关键位置:

DocumentRoot "X:/Apache/htdocs"  默认www文档路径.



php须添加的项目

LoadModule php5_module X:/php/php5apache2_2.dll  添加php模块,这个对应Apache的版本
      PHPIniDir X:/php/          设置PHP的主目录   

ScriptAlias /php/ "X:/PHP/"      添加一些文档格式.
      AddType application/x-httpd-php .php3
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php .phtml 
      Action application/x-httpd-php "/php/php.exe"



PHP

解压之后如果添加了PHP系统环境变量,就不需要将配置文件移动到系统目录中,这样会导致其中的一个配置文件不起作用.所以有时候改系统下的INF但是没起作用.

最好是将/php和/php/ext 都加到系统变量,这样就不需要将文件移来移去的,省事.

配置文件关键位置

extension_dir = "e:/php/ext"   配置php模块加载路径.

用的是wamp5集成环境,Wamp5是Apache+PHP+Mysql 集成环境,默认不支持gd库。

打开方法:php.ini查找extension=php_gd2.dll,将前面的分号删掉然后保存,重启apache服务即可


extension=php_gd2.dll            去掉注释;加载GD库模块

extension=php_mysql.dll         去掉注释;加载mysql模块



MYSQL

mysql没什么好说的

测试mysql环境:到WWW主目录中新建testdb.php,内容如下

<?
      $link=mysql_connect('localhost','root','123456');
      if(!$link) echo "fail";
      else echo "success";
      mysql_close();
      ?>

输出success即正常

你可能感兴趣的:(apache,mysql,PHP,windows,ext)