Learning web together those years of PHP learning together (a)

Source: Internet
Author: User
Tags php language learn php phpinfo
Since the creation of the 1994 PHP language, the magic has been sought after as the preferred language for website design. The release of PHP4.0 in 2000 undoubtedly injected fresh blood into its life, and was respected for its open-source mind. The learning of programming language is nothing more than a practical example of learning grammar and basics. This time I will record PHP 1.1 point process, one is a summary of their own, and secondly for the follow-up encounter the same problem of the learner's doubts.
Note-taking is mainly through the problem of the way, not like a book class, 1.1 points to explore the basis of language. It is mainly in the basic stage of PHP learning to anticipate problems to solve the record, the record never understand the process. Okay, the real PHP language is just the beginning.
1): What kind of development environment and development tools does PHP need?
About the PHP language version of the problem, understand is necessary, but I think there is not much relationship, Baidu/google can find these development version of the problem. 工欲善其事, must choose the benefit of its device! The first time is to configure the development environment, my first contact with the development environment is windows, but this time I would like to follow-up on Linux learning. Now I'm going to show you the deployment of both of these development environments.
2): What is the installation procedure for Windows? What do you need to be aware of?
First of all, windows, generally in order to facilitate the installation of the implementation of the tool suite on windows, I am using wampserver development, WAMP is the Windows Apache Mysql PHP integrated installation environment, that is, under window Apache , PHP, and MySQL server software. Simple one-click installation of the deployment server, database, etc. do not consider too much. Go straight to the next step. However, please note the following points during installation:
1, wampserver program where the path cannot contain Chinese characters and spaces.
2, mysql Default user name: root, password is empty
3. mysql database file storage directory: Wamp\bin\mysql\mysql5.5.8\data
4. Website root directory [html,php]wamp\www
5, access the machine please use HTTP:// 80 port is not occupied)
6, non-default port, the URL is Port/
If IIS server is installed, port 80 is occupied by default and needs to be changed to WAMP service Internet port number: C:\wamp\bin\apache\Apache2.2.17\ Conf folder under the file httpd.conf listen node, modify the port number 80, or you need. After modification, restart all services and run.
Development tools: PHP Development tools: Zend Stodio, Phpedit, EditPlus 2, Easyeclipse, DW, etc. can be completed. The inherited development tool chooses Zend to be more useful.
3): Is the installation package deployment environment also in the Linux environment? Is there a graphical management interface?
However, on Linux we can still do PHP development, here I choose the development environment is lamp (linux+apache+mysql+php), in the Ubuntu release as an example to install the development environment. Apache official network card can download the offline installation package, can also be installed online. It is convenient to choose the online installation here. First use Ubuntu system, enter Window command (ctrl+alt+t)
Installation of Apache
Apache as a powerful Web program, nature is the first choice to build a Web server, OK, below we will install Apache. Under Terminal, enter the following in the polygon command:
sudo apt-get install apache2
Once the installation is complete, Apache will be launched next.
Sudo/etc/init.d/apache2 restart
Enter http://localhost or in the browser, if you see "It works!", it means that Apache installed successfully, Apache default installation, will be under/var set up a directory called WWW, This is the Web directory, all Web files that can be accessed by the browser should be placed in this directory.
Installation of PHP
Installing the software under Ubuntu is a very simple matter, just need a command to do, under the terminal to execute the following command:
sudo apt-get install libapache2-mod-php5 php5
After installation, we will restart Apache and let it load the PHP module:
Sudo/etc/init.d/apache2 restart
Next, we'll create a new PHP file under the Web directory to test if PHP works properly, command:
sudo gedit/var/www/phpinfo.php
Then enter:
(Note: Use the bloginfo to Phpinfo, because the server limit, cannot use the Phpinfo function)
Then save the file, enter the in the browser, if there is a page showing the PHP running parameters, it means that PHP is working properly.
However, if the page is not displayed, but instead prompts you to download the file, which means that APACEH does not load the PHP module correctly, then the solution is, in/etc/apache2/apache2.conf or/etc/apache2/mods-enabled/ In the php5.conf file, add the following line command:
AddType application/x-httpd-php. php. phtml. php3
After adding the above command, the following command should be restarted APACEH this will solve the problem:
Sudo/etc/init.d/apache2 stop
Sudo/etc/init.d/apache2 restart
After there is a situation does not appear this expected page, it is possible that the folder www did not get the appropriate access rights, can be through sudo chmod +x./www Change the permissions of the WWW folder. (Familiar with Linux, this permission management should understand)
installation of MySQL
sudo apt-get install Mysql-server
At the end of the installation, it will be required to enter the root password, note that the root password here is not the root password of Ubuntu Ah, is the root password you want to set up MySQL, of course, if you like, you can set the same is possible. Because it is mainly used for local testing, so the MySQL installation is done here, if it is really to be used as a server, it may have to refer to other settings, as for these settings, the subsequent use to I will write down.
OK, the development environment installation is over, wait for the program to be written in accordance with the rules!

The above introduces a learning network those years together to learn PHP (a), including the content of learning network, I hope that the PHP tutorial interested in a friend helpful.

  • 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.