We all know the powerful functions of PHP. We will give a detailed introduction to the PHP server installation that everyone is worried about and share it with you. Please follow the steps below and come and try the PHP server. Install it!
- Go to www.apache.com to download an http server, and then go to www.php.com to download the php package, which will be used as a module of the apache server. The latest version of the apache http server is now 2.2 .3. This is what I downloaded at the beginning. The installation process is very simple. Then install the php package. The latest version is 5.1.6. It is also very simple. Unzip it to any place, such as C:php, and then put the folder path C :php is added to the environment variable path. Configure php: Copy php.ini-recommended in the php folder to php.ini and it will be ok. Change the apache server to add the php module: Add: to the conf/httpd.conf file:
<ol class="dp-xml"> <li class="alt"><span><span># For PHP 5 do something like this: </span></span></li> <li class=""> <span>LoadModule php5_module "C:/php/php5apache2.dll" </span><strong><font color="#006699"><span class="tag"><span class="tag-name">----</span></span></font></strong><span> LINE 117 </span> </li> <li class="alt"><span>AddType application/x-httpd-php .php </span></li> <li class=""><span> </span></li> <li class="alt"><span># configure the path to php.ini </span></li> <li class=""><span>PHPIniDir "C:/php" </span></li> </ol>
Then restarted the apache server, and the result was an error:
<ol class="dp-xml"> <li class="alt"><span><span>httpd.exe: Syntax error on line 117 of C:/apache/conf/httpd.conf: Cannot load C: </span></span></li> <li class=""><span>/php/php5apache2.dll into server: The specified module could not be found. </span></li> <li class="alt"> <span>Note the errors or messages above, and press the </span><strong><font color="#006699"><span class="tag"><span class="tag-name">ESC</span><span class="tag">></span></span></font></strong><span> key to exit. 20... </span> </li> </ol>
It took me two hours...crying...Solution: next 2.0.59 The apache server is ok. The previous error is caused by a version problem. To check whether it is installed, save the following code as hello.php and put it in htdocs under the main folder where the apache server is installed. Run the server and browse Enter: localhost/hello.php in the server to view.
<ol class="dp-xml"> <li class="alt"><span><strong><font color="#006699"><span class="tag"></span><span class="tag-name">php</span></font></strong><span> </span></span></li> <li class=""> <span>$</span><span class="attribute"><font color="#ff0000">time</font></span><span class="attribute-value"><font color="#0000ff">time</font></span><span> = time(); </span> </li> <li class="alt"> <span>$</span><span class="attribute"><font color="#ff0000">thetime</font></span><span> = </span><span class="attribute-value"><font color="#0000ff">date</font></span><span>("l, jS F Y g:ia",$time); </span> </li> <li class=""><span>echo "Hello world! The time is currently". $thetime ."."; </span></li> <li class="alt"> <span></span><span class="tag"><strong><font color="#006699">?></font></strong></span><span> </span> </li> </ol>
Hey, I encountered a new problem the next day, unable to connect to the database, and the error message was:
<ol class="dp-xml"><li class="alt"><span><span>Call to undefined function mysql_connect() in ... </span></span></li></ol>
The reason is PHP5 unbundles the mysql client, and we need to change the configuration file ourselves. Uncomment the extension php_mysql.dll, and then set the extension_dir and it will be ok. There is no problem with my configuration, and the ddl files are also in the right place, but the problem remains the same, so in the end I had to Changing the software version again, I changed php to 4.4.4. Because 4.4.4 automatically configures mysql, there is no need to change php.ini. You only need to edit the apache configuration file:
<ol class="dp-xml"> <li class="alt"><span><span>#LoadModule php5_module "c:/php/php5apache2.dll" </span></span></li> <li class=""><span>LoadModule php4_module "c:/php/sapi/php4apache2.dll" </span></li> <li class="alt"><span>AddType application/x-httpd-php .php </span></li> </ol>
You can use this PHP server installation test code to test:
<ol class="dp-xml"> <li class="alt"><span><strong><font color="#006699"><span class="tag"></span><span class="tag-name">php</span></font></strong><span> </span></span></li> <li class=""><span>echo phpinfo(); </span></li> <li class="alt"> <span>$</span><span class="attribute"><font color="#ff0000">link</font></span><span> = </span><span class="attribute-value"><font color="#0000ff">mysql_connect</font></span><span>('localhost', 'root', '123456'); </span> </li> <li class=""><span>if (!$link) { </span></li> <li class="alt"><span>die('Could not connect: ' . mysql_error()); </span></li> <li class=""><span>} </span></li> <li class="alt"><span>echo 'Connected successfully'; </span></li> <li class=""><span>mysql_close($link); </span></li> <li class="alt"> <span></span><span class="tag"><strong><font color="#006699">?></font></strong></span><span> </span> </li> </ol>
The gratifying thing is that this time I can find the mysql_connect method, but there is a new error:
<ol class="dp-xml"><li class="alt"><span><span>Client does not support authentication protocol </span></span></li></ol>
I almost want to give up at this point! Thinking of the importance of PHP, I finally gritted my teeth and persisted. This error is because the cryptographic algorithm of the mysql client program in php4 is incompatible with the new mysql server. There seems to be only one solution for php4. Just execute the following command in mysql:
<ol class="dp-xml"> <li class="alt"><span><span>mysql</span><span class="tag">></span><span> UPDATE mysql.user SET </span><span class="attribute">Password</span><span> = </span><span class="attribute-value">OLD_PASSWORD</span><span>('newpwd') </span></span></li> <li class=""> <span>-</span><span class="tag">></span><span> WHERE </span><span class="attribute">Host</span><span> = </span><span class="attribute-value">'some_host'</span><span> AND </span><span class="attribute">User</span><span> = </span><span class="attribute-value">'some_user'</span><span>; </span> </li> <li class="alt"> <span>mysql</span><span class="tag">></span><span> FLUSH PRIVILEGES; </span> </li> </ol>

Golang(Go编程语言)是一种基于C语言的编程语言,被广泛用于Web开发、网络编程、操作系统等领域。然而,在编写Golang程序时经常会遇到一个常见的问题,就是“undeclaredname”(未声明名称)错误。下面将介绍如何解决这个问题。了解错误信息在编译和运行Golang程序时,如果遇到了未声明名称错误,会在控制台输出相应的错误信

Java中的ClassNotFoundException是一种常见的编译错误。当我们尝试使用Java虚拟机(JVM)加载某个类时,如果JVM找不到该类,就会抛出ClassNotFoundException。这个错误可能出现在程序运行时,也可能出现在编译时。在本文中,我们将讨论什么是ClassNotFoundException,它为什么会发生以及如何解决它。C

随着Java的广泛应用,Java程序在连接数据库时经常会出现JDBC错误。JDBC(JavaDatabaseConnectivity)是Java中用于连接数据库的编程接口,因此,JDBC错误是在Java程序与数据库交互时遇到的一种错误。下面将介绍一些最常见的JDBC错误及如何解决和避免它们。ClassNotFoundException这是最常见的JDBC

Go语言是一门越来越受欢迎的编程语言,它的简洁、高效、易于编写的特点已经被越来越多的开发者所认可。而在Go语言开发中,遇到编译错误是不可避免的。其中一个常见的错误就是“undefined:json.Marshal”。这个错误通常发生在你使用了Go标准库的“encoding/json”包时,编译器提示找不到“json.Marshal”的定义。这个问题的根本原

Go语言作为一门快速发展的编程语言,被广泛应用于各种项目和领域。然而,在使用golang编写程序时,你有可能会遇到一些报错,其中一个常见的报错是“undefinedvariableorfunction”。那么,这个错误是什么意思?它是如何产生的?又该如何解决呢?本文将会对这些问题进行探讨。首先,我们需要了解一些基本概念。在golang中,变量和函数是两

在Vue应用中遇到“SyntaxError:Unexpectedtoken”怎么解决?Vue是前端开发中广泛使用的一个JavaScript框架,它可以让我们更轻松地管理页面的状态、渲染和交互。但是在编写Vue应用时,有时会遇到“SyntaxError:Unexpectedtoken”报错,这个错误提示意味着代码中存在语法错误,JavaScript引擎

近年来,Golang一直受到越来越多开发者的青睐。但是,即使是最有经验的开发人员也会遇到一些挫折,比如一些报错。其中,一种常见的报错是:“invaliduseof,operator”。在这篇文章中,我将为大家介绍这个报错的原因,以及解决方法。首先,我们需要了解什么是","操作符。在Golang中,","操作符通常被用来在数组、参数列表或结构体中分隔不

Java作为目前最受欢迎的编程语言之一,在开发过程中常常会遇到各种各样的错误,其中Gradle错误是比较常见的一种。本文将介绍如何解决和避免Gradle错误。一、Gradle错误的原因Gradle为构建工具,其主要作用是将代码、资源文件、第三方库等打包并生成可执行的应用程序。在实际开发中,如果不注意一些细节,很容易出现Gradle错误,主要原因通常有以下几种


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
