Wamp learning diary: Apache released PHP website

Source: Internet
Author: User

1. Modify the httpd. conf file to associate Apache with the PHP module.

2. Configure the php. ini file

 

Modify the httpd. conf file to associate Apache and PHP modules.

How to associate Apache with PHP? Use the configuration file httpd. conf in Apache to configure the PHP module.
Add module: loadmodule php5_module "php path/php5apache2_2.dll"
Create File Association: addtype application/X-httpd-PHP. php
Create a default index: directoryindex index. php default. php index.htm

Create a new site.
<Virtualhost *: 80>
DocumentRoot "Location of the website to be published"
Servername IP Address

</Virtualhost>

 

Modify the php. ini file

1. Search for "extension_dir" in notepad, and then set extension_dir = "./"
Change to extension_dir = "C:/PHP/EXT" // here is the PHP path.

2. In notepad, find "; Extension = php_mysql.dll" and "; Extension = php_gd2.dll", and then remove the preceding ";" to change extension = php_mysql.dll to extension = php_mysql.dll.
Change; Extension = php_gd2.dll to extension = php_gd2.dll

Restart Wamp to use IP address for access.

How to Make PHP support the MySQL module? I have not tried to modify the php. ini file for the time being. I will take a look at the user manual later. In the future development process, user manuals and development documents are equally important. Communication of documents still occupies a lot of space in a certain period of time.

In Windows, you must copy libmysql. dll in the PHP Directory to the Windows directory to allow PHP to support MySQL.

Go to X:/Server/PHP ...... Rename PHP. ini-Recommend to PhP. ini and open it in a text editor ......
Modify the error report level ...... Run some nonstandard programs ...... You will find the full screen 'error '......
Search:
Error_reporting = e_all
To:
Error_reporting = e_all &~ E_notice &~ E_strict
Because it is local debugging, of course I want the error to be output for my debugging ......
Search:
Display_errors = off
To:
Display_errors = on
For local developers, it seems unnecessary to record errors ......
Search:
Log_errors = on
To:
Log_errors = off
It is necessary to set the extension library path ......
Search:
Extension_dir = "./"
To:
Extension_dir = "X:/Server/PHP/EXT"
By default, PHP 5 does not support MySQL ......
Search:
; Extension = php_mysql.dll
Remove the semicolon:
Extension = php_mysql.dll
In addition, VBulletin has already enabled support for mysqli ...... So here we introduce the MySQL extension library ......
Search:
Extension = php_mysql.dll
Add below:
Extension = php_mysqli.dll
Of course, to better use some image-related functions of VBulletin, We need to enable the GD2 library ......
Search:
; Extension = php_gd2.dll
Remove the semicolon:
Extension = php_gd2.dll
We also want to call some frequently-used libraries, such as php_mbstring.dll, php_curl.dll, php_sockets.dll, php_xmlrpc.dll, etc ...... Use the same method as above ......
(Only common extensions are enabled here ...... Determine other extensions as needed ......)
Although VBulletin uses its built-in session mechanism, PHP's session mechanism is essential in many programs ......
Search:
; Session. save_path = "/tmp"
Change to an existing path ......
Or create a tmp directory under the release directory ......
Here we use the previous method ...... First create a directory X:/session ......
Then modify it:
Session. save_path = "X:/session"

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.