Manually Configuring the WAMP Environment (4)--php configuration

Source: Internet
Author: User
Tags configuration settings

  • PHP Environment Configuration
  • Configure Apache

    Configuration file Syntax Description: httpd.conf// annotation method is "#"

  • LoadModule, loading the PHP module

    LoadModule php5_module C:/wamp/php/php5apache2_2.dll

  • AddType, check to see if you can parse the. php

    AddType application/x-httpd-php. php

  • Phpinidir, setting the php.ini configuration file path

    Phpinidir c:/wamp/php

  • Configure PHP

    PHP5 configuration settings (php.ini): Modify the configuration file path, generate the configuration file, load the MySQL module,

    PHP configuration file Syntax description php.ini// the comment is ";"

  • Open PHP Extensions

  • Set extension path

  • Setting the time zone

  • Configure MySQL (the installation process is already configured)
  • Summary Profile apache,php
  • httpd.conf

  • php.ini

    To test the code for the connection database:

    1<?PHP2 3 $link=mysql_connect(' localhost ', ' root ', ' root ');//If the connection is successful, a connection identifier is returned;4 5 if($link){//If there is a database connection identity, the connection is successful6 7 Echo"Connecting the database successfully";//Echo is the meaning of the output8 9}Else{//failed to connect to database without return identityTen  One Echo"Failed to connect to database"; A  - } -  the?>

    To test the time zone code:

    1 <? PHP 2 3 echo "Now time is:",date(' y-m-d h:i:s '); 4 5 ?>

    PS: reconfigure MySQL

     

Manually Configuring the WAMP Environment (4)--php configuration

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.