PHP Lesson two learn about PHP's basic syntax and directory structure

Source: Internet
Author: User

Through this class,

1. Understanding the APPSERV directory structure

2. We can understand the basic syntax structure of PHP


1 My Appserv installation directory is e-drive:



① using the command line to operate the Apache server


Apache server open and close:
Httpd-k Restart//restart
Httpd-k Stop//Off
Httpd-k Start//Open


If you modify the port, you can modify it in the following directory:
Httpd.conf in appserv\apache2.2\conf (Master profile)



② using the command line to operate the MySQL database
MySQL database is turned on and off:
net stop MySQL//shutdown database
net start MySQL//Open database


③mysql Database Server Description:
1. Installation path: E:\AppServ\MySQL
2. Command path: E:\AppServ\MySQL\bin
3. configuration file: E:\AppServ\MySQL\my.ini
4. Database Storage directory: E:\AppServ\MySQL\data


E:\AppServ\MySQL\data\mysql
. FRM table Structure
Columns_priv. MYD table Data
Columns_priv. MYI Index



④php's distribution file
C:\Windows\php.ini

①php Mark
Write a PHP program index.php
<?phpphpinfo ();? >


<?phpecho "Hello world";? >


② Note: PHP code can be written only in a. php suffix file, and the PHP code must be unloaded between <?php?>


③ write HTML code in PHP, nested PHP tags in html
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >

④php notes:
/* * * Multi-line Comment

Single-line Comment


⑤. Instruction Separator
Must end with;
⑥.php Code Writing format, note indentation, {code snippet}
⑦.php a blank line between a statement and a function, a function and a function
Up and down with curly braces, separated by blank lines, easy to read
⑧. Variables
The name should be meaningful, don't use letters, individual numbers, or Chinese

The file name and directory name do not use Chinese



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.