


Installation and configuration methods of Windows Apache2211 and Php529-1
Because pharmar uses Mcafee’s anti-virus software, all programs are required to be installed in Program Files, so these files are placed under D:Program Files for easy management. Mcafee is easy to use when writing protection rules.
Installation and configuration of Apache
Open the official apache website http://archive.apache.org/dist/httpd/binaries/win32/ or the mirror website http://apache.mirror.phpchina.com/httpd/binaries/win32/ , download the apache_2.2.11-win32-x86-no_ssl.msi installation file inside. Among them, there are two types of the same version: no_ssl and openssl. Openssl has an additional SSL security authentication mode. Its protocol is HTTPS instead of HTTP. This is the difference between a server with SSL and a general web server. Under normal circumstances, it will be ok if we download the no_ssl version.
After downloading the apache installation file, click Install. After three consecutive times of next, you will enter the server information configuration interface, which requires you to enter the network domain, server domain and website administrator’s email address. Ordinary users can just fill in the format according to the format. . After pressing Next again, an interface for selecting the installation path appears. The default path is relatively long. Pharmar changes the installation path to: "D:Program FilesApache" and continues the installation until it is completed.
After the installation is completed, apache will start automatically. You can test whether apache starts successfully. Enter: http://localhost/ or http://127.0.0.1/ in the browser address bar. If "It works." appears, congratulations, apache has been successfully installed; at the same time, click on the taskbar in the lower right corner of the computer. There is a green apache server running icon.
Apache also has a configuration file: httpd:conf that needs to be configured in order for php to run. The location is: D:Program FilesApacheconf directory. Open httpd:conf:
1), search for "DocumentRoot", this is the directory where the specified homepage is placed. The default is: "D:Program FilesApachehtdocs". You can use the default directory or define one yourself, such as: "D:/PHP". Note: Do not add "/" at the end of the directory.
2)、查找“DirectoryIndex”,这里是默认首页文件名,可以在index.html 的后面加入index.php等。每种类型之间都要留一个空格。
3)、查找
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
修改为:
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
如果不改这里的话,可能会出现 You don't have permission to access / on this server. 这样的错误提示,尤其在改变了默认主页的路径后。
注意:每次修改httpd:conf文件后,都要重启apache服务器。另外,如果你的win32系统上同时也运行iis服务器,那么就要先停止iis服务器的运行,然后再启动apache,否则apache服务器无法启动。
Php的安装与配置方法
首先从php的官方网站http://www.php.net/downloads.php 下载windows版本的,有两种版本:PHP 5.2.9 zip package和PHP 5.2.9 installer,目前最新版本就是5.3.0,pharmar使用的是5.2.9版本。PHP 5.2.9 installer为自动安装方式,虽然比较自动化,但在很多方面受到限制,因此pharmar不推荐使用这种方式,下面介绍PHP 5.2.9 zip package压缩包方式下的手动安装。
1)、将PHP的压缩包zip解压到一个目录下,推荐:“C:/PHP”,pharmar的是D:\Program Files\Php。
2)、将PHP目录(D:\Program Files\Php)下的 php.ini-dist 文件重命名为 php.ini,PHP的配置文件就是它,修改以下几个地方,修改好后把 php.ini 文件复制到 C:\WINDOWS\ 目录里:
extensi ,指向php文件夹下放置“php_*.dll”文件的路径。PHP4和PHP5的路径在这里有所区别。
doc_root="D:\PHP" ,指向前面apache设置的首页位置;
default_charset="gb2312" ,修改默认字符集,这里,如果前面有分号“;”,去掉这个分号;
register_globals=Off 改为 register_globals=On ,使传递全局变量有效;
extension=php_dba.dll 如果前面有分号,取消分号,以下同;
extension=php_dbase.dll
extension=php_gd2.dll GD库做图,一般用于图形验证码;
extension=php_mysql.dll 用于连接MYSQL数据库;
3)、将PHP目录下的 php5ts.dll 文件拷贝到 C:\WINDOWS\system32 目录。
4)、最后修改 Apache 的 httpd.conf 文件。在该文件的末尾添加如下2行,表示以模块方式安装PHP进入Apache:
LoadModule php5_module D:/Program Files/Php/php5apache2_2.dll
AddType application/x-httpd-php .php
注意:第一行的目录路径要更新为当前版本的apache动态链接库,比如这里我使用的是apache2.2.11版本和php5.2.9,那这个文件必须是php5apache2_2.dll,而不能是php5apache.dll、php5apache2.dll等。第二行为php脚步的后缀。
php4版中,需要添加一行 AddType mod_php4.c,而在php5中,就不需要这样的一行 AddType mod_php5.c了,php5已经集成,否则 apache 启动不了。
以上就完成了apache和php的配置过程了,重启apache。在服务器的默认目录“D:\Program Files\Apache\htdocs”里新建文件index.php,写上如下代码:
phpinfo();
?>
在浏览器地址栏里输入 http://127.0.0.1/ 或 http://localhost/ ,你就会看到php版本信息了。到此为止,php和apache就已经成功的安装了。
这里有个细节:apache的配置文件 httpd.conf 中的目录分割符号是“/”,而 PHP 的配置文件 php.ini 里的目录则要求是反斜线 “ \”,不要搞混了哦。
MYSQL的安装就简单了。到官方网站 http://dev.mysql.com/downloads/mysql/5.0.html,下载windows平台下的 mysql ,选择 Windows ZIP/Setup.EXE (x86) 最新版本是 5.0.77 ,下载即可。直接安装,安装完成后,可以进入配置向导,设置mysql数据库密码。一切OK。
关于mysql的安装与配置见:phpMyAdmin安装配置方法和问题解决
pharmar安装过程中遇到的错误:
在 Windows 下安装 PHP 后 Apache 出现 LoadModule takes two arguments 的错误,这个主要原因就是httpd.conf中的这句:
LoadModule php5_module D:\Program Files\PHP\php5apache2_2.dll
解释程序把Program Files中的空格当成了两个参数的分隔符号,因此语句中不能出现空格。在网上找了半天也没找到解决方法,最后用一级目录符号才解决问题,改成如下:
LoadModule php5_module ../php/php5apache2_2.dll
因为apache安装在D:\Program Files\Apache\目录下,PHP安装在D:\Program Files\php\,因此../就表示D:\Program Files\目录,这个终于搞定了,希望大家在安装与配置过程中多动动脑筋总会有办法的。
The above introduces the installation and configuration methods of Windows Apache2211 and Php529-1, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


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

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software