Installation of PHP
Since php is a zip file (non-install version), the installation is relatively simple, just unzip it. Rename the decompressed php5.2.1-Win32 to php5. And copy it to the installation disk directory. For example, the installation path is c:php5
1 Find the php.ini-dist or php.ini.recommended file in the php directory, rename it to php.ini, and copy it to the windows directory of the system disk (take c:windows as an example, 2000 is in the winnt directory , the following are explained using the methods of netizens).
2 Then copy php5ts.dll and libmysql.dll in the php directory to the directory c:windowssystem32.
3 Copy the php_gd2.dll, php_mysql.dll, php_mbstring.dll files in the php5ext directory to c:windowssystem32. If php_gd2.dll is not loaded, php will not be able to process images. php_mysql.dll is not loaded. PHP will not support the mysql function library. php_mbstring.dll will support wide characters when using phpmyadmin later. After everything is installed, we will configure
php and associate it with MySQL.
Open the c:windowsphp.ini file
1 Set the extension path to find extension_dir. There is such a line
extension_dir = "./"
Change this line to
extension_dir = "C:php5ext"
Where C:php5 is the path where you installed php. Incorrect path will not load the dll
(Note: Some PHP versions are; extension_dir = "./" to remove the preceding semicolon)
2 Find extension
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_mysql.dl
Remove the semicolon in front of the above three items, so that these dlls can be loaded when apache starts. Of course, we also copied these dlls to system32 before. 3.
Set the session save path and look for session.save_path. There is such a line
; session.save_path = "N;/path"
Add a line after this line (note that you are adding a line, not adding it to the end)
session.save_path = "C:WINDOWSTemp"
Save it to your temporary directory. You can save it to the Windows temporary directory Temp
4. It is also worth noting that short_open_tag is Off by default, which means that PHP cannot use short tags such as <? ?> and must use <?php ? >
Since short tags are easy to use, and many programs are written with short tags, such as discuz, etc. If you do not change short_open_tag to On, it will be difficult to determine whether the symptoms are due to the above reasons. It is recommended to modify the search here.
short_open_tag = Off
Change to
short_open_tag = On
5 whether to display errors display_errors
For security reasons, display_errors also defaults to Off
That is to say, during debugging, if there is an error in the PHP code, only a blank page will appear. The cause of the error and the number of error lines will not be displayed.
This will be very inconvenient to debug. It is recommended to modify the search according to your needs.
display_errors = Off (note not; - display_errors = Off [Security])
Change to
display_errors = On
6 register_globals
For security reasons, it is also Off by default.
When register_globals=Off, the next program should use $_POST['user_name'] and $_POST['user_pass'] when receiving)
When register_globals=On, the next program can directly use $user_name and $user_pass to accept values.
For more detailed instructions, please refer to
http://www..net/bbs/archiver/?tid-234.htm
the 7php5 time difference issue
according to your own needs.
<?php echo date("Ymd H:i:s");?> Why is the time different by eight hours? The PHP5 series version has a new time zone setting. The default is Greenwich Mean Time, which is exactly the same as the East 8th District where China is located. There is such a line when searching date.timezone for 8 hours
;date.timezone =
Remove; and change it to
date.timezone = PRC
Among them, PRC: People's Republic of China,
For more detailed solutions, please refer to this forum
http://www..net/bbs/archiver/?tid-60.html
More articles PHP enthusiast site http://www..net/
Apache integrates PHP
1 Open the apache configuration document from the start menu
2 Modify the website root directory and find the following line in DocumentRoot
DocumentRoot"C:/Program Files/Apache Group/Apache2/htdos"
This is the root directory of your website. You can modify it or use the default one. If you change it, you also need to modify the following items, otherwise a 403 error may appear. This should be changed to whatever you set DocumentRoot to
Two lines below it are
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Change C:/Program Files/Apache Group/Apache2/htdos in the above two items to the directory you want
3. Find DirectoryIndex index.html index.html.var
Modify to
DirectoryIndex index.html index.html.var index.php
In this way, index.php can serve as the default page.
4 Modular installation of php in Apache
Find #LoadModule foo_module modules/mod_foo.so
Add a line after this line
LoadModule php5_module C:/php5/php5apache2.dll
where C:/php5/php5apache2.dll is the corresponding path where you install php.
Be careful not to confuse php5apache2.dll with php5apache.dll. php5apache.dll only works with apache version 1.
Note: php5apache2.dll in the PHP5 compressed package is only suitable for apache2.0.* version. If it is 2.2.* or above version, it may appear.
"Cannot load C:/php/php5apache2.dll into server: The specified module could not be found."
or:
"The requested operation has failed"
situation. For solutions to this problem, please refer to this forum
http://www..net/bbs/viewthread.php?tid=857&extra=page%3D1
5 Find AddType application/x-gzip .gz .tgz
Add a line after this line
AddType application/x-httpd-php .php
In this way, apache can interpret the php file. The configuration is basically completed here
########Restart apache#########
Create a phpinfo.php file in the root directory of the website
<?php
phpinfo();
?>
Open in browser
http://localhost/phpinfo.php
If the following information appears, it means that php has been configured
Next, test the association between php and mysql database. Create a test.php file in the root directory of the website
CODE:[Copy to clipboard]<?php
$link=mysql_connect("localhost","root","12345"); //Change 12345 to your mysql password
if(!$link) echo "Failed!";
else echo "Success!";
mysql_close();
?>
Open http://localhost/test.php in the browser
If the output is successful, it means you are done.
Install phpMyAdmin
and download phpMyAdmin-2.7.0.zip, unzip it to the root directory of your website and rename it to phpMyAdmin.
Find and open config.defaut.php (some versions are config.inc.php or libraries/config.default.php)
Make the following modifications:
1. Search for password and have the following two lines:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
Fill in your mysql password inside the single quotes $cfg['Servers'][$i]['password'] = '';
2 Search $cfg['PmaAbsoluteUri'] and set it to the phpMyAdmin directory path, such as: http://localhost/phpMyAdmin/ ;
modify the following two items according to the encoding you need (if you are not very familiar with database encoding, it is recommended Do not modify)
3 Search $cfg['DefaultLang'] and set it to zh-gb2312;
4 Search $cfg['DefaultCharset'] and set it to gb2312;
open the browser and enter: http://localhost/phpMyAdmin/ , both Apache and MySQL have been started.
If the following page appears, the phpmyadmin installation is complete and can be used.
Please slowly familiarize yourself with the specific functions of phpMyAdmin and will not go into details here.
My comprehensive summary:
1. The installation directory should be named in English as much as possible, and the same goes for the files (who said China is lagging behind?)
2. Apache provides web services. I have not verified the MYSQL database connection. I installed it directly using a PHPWIND forum. , to prove that the connection is successful, it is best to go to the official website for php, etc. (I first used PHP5.2.1 that I downloaded from someone I don’t know where. As a result, a file was missing and it always said that the module could not be loaded. It took me a long time to find out, which was very frustrating)
3. My system is the 2000 server version under D , therefore, c:windows should be changed to d:winnt. You should understand this.
4. In addition, it is easier to configure PHP under iis:
Installation method of PHP+IIS under Windows 2000
<1>, unzip php-5.0.0 (recommended if there is a new version)-Win32.zip and put it in C: php.
<2>. Copy php.ini-dist to the Winnt directory and rename it to php.ini. Copy php5ts.dll and libmysql.dll to WINNTsystem32.
<3>. Next, make settings in IIS, open the Default Site Properties dialog box, switch to the "Home Directory" tab, then click the "Configuration" button to open the "Application Configuration Dialog Box", click the "Add" button to open the " Add/Edit Application Extension Mapping dialog box. In the "Executable File" input box, point to c:/php/php5isapi.dll, enter ".php" (excluding quotation marks) in the "Extension Name" input box, and select "Script Engine" and "Check whether the file There are two check boxes, confirm and exit IIS.
At this point the server should be able to support both asp and php.
Next, configure php.ini to make php support MYSQL and GD library
<1>, search for "extension_dir" in Notepad, and then put
extension_dir = "./"
Modify to
extension_dir = "C:phpext"
<2>, search for ";extension=php_mysql.dll" and ";extension=php_gd2.dll" in notepad, and then remove the previous ";", that is,
;extension=php_mysql.dll
Change to
extension=
php_mysql.dll
;extension=php_gd2.dll
Change to
extension=php_gd2.dll
<3>, save php.ini, and then restart IIS
php5.12+apache2.054+mysql5.0 installation notes under window xp
1. Install apache
apache_2.0.54-win32-x86-no_ssl. It is very easy. Just click next and it will be ok. After the installation is completed, open the htdocs folder in the installation directory and modify the suffix of any file in it to htm.
Open http://localhost to check whether the installation is successful.
2. Install php5,
unzip php-5.1.2-Win32 to the directory c:php, and copy php5ts.dll in the directory to the c:windows directory.
Copy the following dll files in the c:PHP directory to the C:windowssystem32 directory:
fdftk.dll
fribidi.dll
gds32.dll
libeay32.dll
libintl-1.dll
libmhash.dll
libmysql.dll
libmysqli.dll
ntwdblib.dll
ntwdblib.dll
yaz.dll
Among them, libmysql.dll is the extended support for versions before MySQL 4.1, and libmysqli.dll is the extended support for versions after MySQL 4.1. Because what I downloaded above is MySQL 4.0.20, I can actually copy libmysql.dll.
Copy the php.ini-dist file in the C:PHP directory to the C:windows directory, rename it php.ini, and open it for editing with Notepad:
Locate the following two lines:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
Modify the following line to point it to the c:PHPext directory, as follows:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:PHPext"
remove the ; before extension=php_mysql.dll
3. Modify the httpd.conf file in the apache directory and locate the following line:
DirectoryIndex index.html index.html.var
Add a PHP default page after it, usually index.php, as follows:
DirectoryIndex index.html index.html.var index.php
In order for Apache to recognize the relevant extensions for PHP, search and locate the following section:
<Directory "c:/apache/Apache2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Add the following two lines after:
AddType application/x-httpd-php .php .phtml .php3 .php4
AddType application/x-httpd-php-source .phps
Specify the php module, find and locate the following line:
#LoadModule ssl_module modules/mod_ssl.so
Add a line below:
LoadModule php5_module c:PHPphp5apache2.dll
Make it point to the php5apache2.dll file in the PHP5 directory. The path must be accurate.
If you want to disable directory browsing, find and navigate to the following lines:
Options Indexes FollowSymLinks
Just remove a few lines of comments and add the following line of Indexes. After modification:
Options FollowSymLinks
OK, save the httpd.conf file and restart the Apache server.
Write a PHP test file~OK~!
3. Install mysql-5.0.0-alpha-win, NEXT~~ok!