轻松搞定PHP5+apach2+mysql
有个美国客户要改个小网站,要我帮忙。只能拣起荒废多日的PHP,重新看看.
第一关就是配置. 配置这个破东西与JAVA环境一样难伺候..为什么标榜自由的东西,总是那么难搞呢???
是个矛盾. 下面部分东西是抄袭了别人的东西,不要怪我。 打字太累.
mysql-4.1.22-win32
apache_2.0.55-win32-x86-no_ssl
php-5.2.0-Win32
phpMyAdmin-2.6.2-rc1
Zend (客户要求2.6,今天太晚,我没装呢。 明天补上)
以上软件可以到各大下载网站下载.或者直接登陆官方网站下载.而且配置教程也是一大堆,我就不做详细的技术文献了..
php的官方网站 http://www.php.net/?有中文语言服务,你甚至可以找到最新的中文php手册
php的下载页面 http://www.php.net/downloads.php
apache的官方网站 http://www.apache.org/
apache的下载页面 http://archive.apache.org/dist/httpd/
MySQL作为一款数据库软件最大的特点就是免费,当然他也非常高效,有和php相似的特性
MySQL官方网站 http://www.mysql.com/
安装好所有程序后.开始着手配置了.:
首先配置apache2
打开Apache2conf文件夹下面的httpd.conf配置文件
到最后 加入
LoadFile c:/php/php5ts.dll //加载php5ts.dll,这无论是apache还是IIS都必须以来的链接库
LoadModule php5_module c:/php/php5apache2.dll //加载php5的apache模块
AddType application/x-httpd-php .php
''www.111cn.net
查找DocumentRoot,后面是"C:/Apache2/htdocs"可能因安装路径不同而不同,
是web网页的目录所在地,可改成自己需要的地方,注意,是斜杠"/"不是反斜杠"",毕竟这是linux下面移植过来的
查找DirectoryIndex,后面应该是index.html index.html.var
这是默认的首页名称,要再添加index.php index.htm
然后是配置php
把C:php文件夹下的php.ini-recommended改名,改名为php.ini
PHP.ini:出于安全和效率的考虑,建议使用php.ini-recommended作为php.ini的蓝本,而不要使用php.ini-dist。同时PHP.ini的查找路径也不再限于PHP4时代的%SystemRoot%下了,PHP5按照以下路径查找PHP.ini:
* PHPIniDir (Apache 2 module only)
* 注册表键值:HKEY_LOCAL_MACHINESOFTWAREPHPIniFilePath
* 环境变量:%PHPRC%
* PHP5的目录 (for CLI), 或者web服务器目录(for
SAPI modules)
* Windows目录(C:windows or C:winnt)
这五个方案中,配合Apache2时最好使用PHPIniDir,其次是使用%PHPRC%环境变量,另外,NTFS上记得给服务器开PHP.ini的读权限。
打开php.ini,查找extension_dir后面的改为"C:/php/ext",看看那个文件夹就知道是什么东西了
查找Windows Extensions,那下面有一排的;extension=php_***.dll
开始去分号了,去掉就是支持组件
起码把
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
前面的分号去掉
php5开始默认不支持mysql了,所以我们要为他添加支持,除了extension=php_mysql.dll去分号之外
在php目录里有个libmysql.dll文件,把它复制到系统的system32文件夹下,复制php.ini到windows目录下
重启动机器 .OK .写了个地球人都知道的. hello word
php
echo ''Hello World!'';
?>
看到没? 看到了就OK,看不到。那没办法,重新CHECK每个步骤.
..没办法,懒啊..

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











MySQL and phpMyAdmin can be effectively managed through the following steps: 1. Create and delete database: Just click in phpMyAdmin to complete. 2. Manage tables: You can create tables, modify structures, and add indexes. 3. Data operation: Supports inserting, updating, deleting data and executing SQL queries. 4. Import and export data: Supports SQL, CSV, XML and other formats. 5. Optimization and monitoring: Use the OPTIMIZETABLE command to optimize tables and use query analyzers and monitoring tools to solve performance problems.

AI can help optimize the use of Composer. Specific methods include: 1. Dependency management optimization: AI analyzes dependencies, recommends the best version combination, and reduces conflicts. 2. Automated code generation: AI generates composer.json files that conform to best practices. 3. Improve code quality: AI detects potential problems, provides optimization suggestions, and improves code quality. These methods are implemented through machine learning and natural language processing technologies to help developers improve efficiency and code quality.

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

In MySQL, add fields using ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column, delete fields using ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop. When adding fields, you need to specify a location to optimize query performance and data structure; before deleting fields, you need to confirm that the operation is irreversible; modifying table structure using online DDL, backup data, test environment, and low-load time periods is performance optimization and best practice.

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

Efficient methods for batch inserting data in MySQL include: 1. Using INSERTINTO...VALUES syntax, 2. Using LOADDATAINFILE command, 3. Using transaction processing, 4. Adjust batch size, 5. Disable indexing, 6. Using INSERTIGNORE or INSERT...ONDUPLICATEKEYUPDATE, these methods can significantly improve database operation efficiency.

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.

Methods for configuring character sets and collations in MySQL include: 1. Setting the character sets and collations at the server level: SETNAMES'utf8'; SETCHARACTERSETutf8; SETCOLLATION_CONNECTION='utf8_general_ci'; 2. Create a database that uses specific character sets and collations: CREATEDATABASEexample_dbCHARACTERSETutf8COLLATEutf8_general_ci; 3. Specify character sets and collations when creating a table: CREATETABLEexample_table(idINT
