windows8.1 下搭建配置apache+php+mysql,windows8.1apache
windows8.1 下搭建配置apache+php+mysql,windows8.1apache
软件版本:
apache:Apache 2.4.10 Win64 http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.10-win64-VC11.zip
PHP:VC11 x64 Thread Safe http://windows.php.net/downloads/releases/php-5.6.0-Win32-VC11-x64.zip
MySql:5.5 win64
Visual C++ Redistributable for Visual Studio 2012 http://download.microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x64.exe
Mysql安装:
双击运行,设置用户名、密码、编码(utf8),步骤省略!
PHP配置:
1、解压下载的zip文件到一个目录,本教程中为:D:\Program Files\php
2、复制文件php.ini-development并改名为php.ini;
3、在php.ini文件中搜索关键字php_mysqli.dll,去掉该行前面的";",开启mysql扩展(使用mysql数据库);
4、搜索关键字extension_dir,修改为:extension_dir = "D:/Program Files/php/ext"(视具体目录而定);
5、依次修改
支持session :session.save_path = "e:/temp"
上传文件目录配置 :upload_tmp_dir = "e:/temp"
时区配置 :date.timezone = Asia/Shanghai
apache配置:
0、安装Visual C++ Redistributable for Visual Studio 2012
1、解压下载的zip文件到c盘:C:\Apache24
2、conf目录httpd.conf文件,定位到LoadModule,在其后面添加:(目录视具体php目录而修改)
LoadModule php5_module "D:/Program Files/php/php5apache2_4.dll"
PHPIniDir "D:/Program Files/php"
3、定位到AddType,在其后面添加:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
4、如果要修改apache的端口,定位到Listen 80,例如修改为:Listen 8088
5、安装apache服务。
以管理员的身份开启一个dos窗口,如果不是管理员身份,会报错。win8及win8.1系统可在开始页按C进行搜索,第一个:命令提示符 ,右击,选择 以管理员身份运行即可。
命令提示符默认路径是:C:\windows\system32 ,假设按上述步骤你将apache24文件夹放到了C盘根目录,则在命令提示符中输入:cd c:\apache24\bin ,回车之后即可进入bin文件夹,然后再输入:httpd.exe -k install .(当然,启动|停止|重启的话,都需要用到-k这个参数,也就是httpd.exe -k start|stop|restart。)
如果安装成功,以后就可以去你的apache目录下的bin里双击ApacheMonitor.exe管理apache服务了。
测试配置:
浏览 http://localhost/index.html,(如果修改过端口,例如本教程中为:http://localhost:8088/index.html)显示“It works!”,说明apache启动成功。
在目录:C:\Apache24\htdocs,(apache默认网站目录)新建index.php文件,
<?<span>php </span><span>phpinfo</span><span>(); </span>?>
浏览:http://localhost/index.php,如果修改过端口,例如本教程中为:http://localhost:8088/index.php
显示php版本信息页面,即为成功:
测试mysql连接,在刚才目录新建文件mysql.php,如下:
<?<span>php </span><span>$connect</span>=<span>new</span> mysqli("localhost","root","root","test"<span>); </span><span>if</span>(!<span>$connect</span>) <span>echo</span> "Mysql Connect Error!"<span>; </span><span>else</span> <span>echo</span> "mysql success"<span>; </span><span>$connect</span>-><span>close(); </span>?>
页面打开mysql.php,成功则输出mysql success
1.安装apache_2.2.4-win32-x86-no_ssl.msi到 d:\phpWeb\APACHE\
步骤:下一步下一步
2.安装php-5.2.0-Win32.zip 到 d:\phpWeb\php\
步骤:(1)解压压缩包到d:\phpWeb\php\
(2)找到php目录里的 php.ini-dist 重命名为 php.ini 并拷到 windows目录里
(3)将php目录里的 php5ts.dll,libmysql.dll 拷到 系统目录(system/system32)
3.配置apache
步骤:(1)打开 d:\phpWeb\APACHE\conf\httpd.conf 这个文件
(2)找到 DocumentRoot "D:/phpWeb/APACHE/htdocs" 将其改为你的WEB目录(可不改有时改了会出错)
(3)找到DirectoryIndex index.html这一行,在后面加入index.html.var index.htm index.php
(4)找到#LoadModule ssl_module modules/mod_ssl.so这行,在后面加上一行:LoadModule php5_module d:/phpWeb/php/php5apache2_2.dll
(5)找到AddType application/x-gzip .gz .tgz这行,在后面加上一行:AddType application/x-httpd-php .php
4.配置php
步骤:(1)找到c:\windows\php.ini并打开 (刚才拷进去的)
(2)找到extension_dir = "./" 改为 extension_dir = "d:/phpWeb/php/ext"
(3)找到;extension=php_mysql.dll将前面的;号去掉
(4)找到;session.save_path = 去掉前面;并设路径"d:/phpWeb/php/session_temp"并在该路径下新建文件夹session_temp
5.MySQL装了就可以
楼主,你好,初学者建议直接用php集成环境,比如WampServer,另外,如果对这方面不懂,环境搭建好了,也不会用,建议你到php100 学习,免费而且比较系统,个人觉得不错。希望可以帮到你,祝你成功!

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





The differences between php5 and php8 are in terms of performance, language structure, type system, error handling, asynchronous programming, standard library functions and security. Detailed introduction: 1. Performance improvement. Compared with PHP5, PHP8 has a huge improvement in performance. PHP8 introduces a JIT compiler, which can compile and optimize some high-frequency execution codes, thereby improving the running speed; 2. Improved language structure, PHP8 introduces some new language structures and functions. PHP8 supports named parameters, allowing developers to pass parameter names instead of parameter order, etc.

How to change port 80 in php5: 1. Edit the port number in the Apache server configuration file; 2. Edit the PHP configuration file to ensure that PHP works on the new port; 3. Restart the Apache server, and the PHP application will start running on the new port. run on the port.

The syntax differences between php7 and php5 are: 1. PHP7 introduces strict type declarations, while the type of PHP5 variables is implicit; 2. PHP7 introduces support for scalar type declarations, but PHP5 does not; 3. PHP7 introduces NULL Merge operator, while PHP5 checks whether a variable exists and is not null, you need to use a conditional statement; 4. PHP7 adds a new comparison operator "<=>", but PHP5 does not; 5. PHP7 introduces a new feature anonymous class , while PHP5 does not.

Solution steps for php5 not listening to port 9000: 1. Check the PHP-FPM configuration file; 2. Restart the PHP-FPM service; 3. Turn off the firewall or configure port forwarding; 4. Check whether other processes occupy port 9000.

If you are a website administrator, you may encounter a situation where you need to change the PHP5 port from the default port 80. This process may be a little hurried, but as long as you follow the steps below, it will be easily completed.

When using PHP5, some users may encounter the situation that port 9000 cannot be listened to. At this time, we need to perform some configuration and troubleshooting work to solve this problem.

The differences between the version of php7 and 5 include performance improvements, scalar type declarations, return value type declarations, exception handling improvements, anonymous classes, syntax improvements, new operators, enhanced error handling and the removal of some old features. Detailed introduction: 1. Performance improvement. PHP7 introduces a new Zend engine, named Zend Engine 3.0, which brings significant performance improvement. The performance of PHP7 is approximately twice that of PHP5, mainly through improved memory management. , optimized function calls and exception handling, enhanced garbage collection, etc.

PHP is a widely used server-side programming language used to develop dynamic websites and applications. In recent years, the release of PHP7 has attracted some attention. PHP7 has many improvements and optimizations over previous versions (such as PHP5). In this article, we will explore the syntax differences between PHP7 and PHP5.
