[Switch] php Elementary tutorial (I) building a php platform
As a php learner, we should first build a php testing platform. here I will introduce how to learn php with my own experience. although I am not a php expert, I am at least familiar with it, if you are new to php, you can start learning php from here. Not to mention nonsense. let's start
Build a simple LAMP platform.
What is LAMP, in fact, is Linux + Apache + Mysql + PHP (Here P is php. Perl ). But for windows, we have to build a WAMP. I used to download the windows compressed package file on apache.org, mysql.com, and php.net, and then configure it. However, this configuration is troublesome, although I can proceed step by step according to install, but since there is a simpler method, why don't we use it. Introduction I am now using a simple WAMP, uniform server (http://www.uniformserver.com /). Here (sourceforge) loads a compressed package. if the speed is slow, use thunder to search for "uniform server" for download, about 10 MB. after decompression, double-click start in the file. vbs can access http: // localhost/a/and select phpmyadmin on the left to manage and create a database. the default user and password of the database are root. (you can skip this section for php referers, now I am familiar with php ). After starting the service, you will find that you have an extra w disk, which is a virtual disk and has a www directory under the w disk. you can delete the files in it. Here is the root directory of your website. we can start learning PHP from here. Are you familiar with the C language? Strictly speaking, can I write simple C programs? Or a lower requirement. can you understand a simple C language program? If none of these answers are correct, please purchase a book designed in C language by Tan Haoqiang. what? I don't know who Tan Haoqiang is? I'm afraid of you. just buy a C-language book! The difference between PHP and C. Php language At the end, you can also use simpler labels. here we will use a regular method to prevent future compatibility issues, so we will not learn variables. Php variables must start with $. For example, $ var = 'cosbeta. Php can use variables at any time without pre-definition. C, you must first define a variable to use this variable. In fact, there are still many, such as object-oriented, interpretation, or compilation and execution. it is not too late for beginners to know so much about it. Let's continue. First php program
<? Php
Echo "hello world"; // the comment can be written in this way.
Save the code as "helloworld. php" and put it in the website root directory described above. Then http: // localhost/helloworld. php is used to check what the result is? Are you a little excited ??
Tips: you can use editplus or ultraedit to edit php. I personally like editplus, which is fast.
Reference address: http://www.storyday.com/html/y2007/379_php-course-lamp.html