Those years studying together PHP (i)

Source: Internet
Author: User
Tags php language phpinfo zend

PHP, is the abbreviation of English Super Text preprocessing language hypertext preprocessor. PHP is an HTML embedded language, is a server-side implementation of embedded HTML document scripting language, language style has similar to C language, is widely used. 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://127.0.0.1/(if 80 port is not occupied)

6, non-default port, the URL is http://127.0.0.1: 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)

Apache Installation
 apache as a powerful Web program, is naturally the first choice to build a Web server, OK, let's install Apache. Under terminal input under the polygon command:
    sudo apt-get install apache2
  after installation, the next step is to launch Apache
     sudo/etc/init.d/apache2 Restart
Enter http://localhost or http://127.0.0.1 in the browser, if you see "It works!", That means that Apache has successfully installed, Apache default installation, will be under/var to create a directory called WWW, this is the Web directory, all the Web files to be able to access the browser will be placed in this directory.
           php installation
Installing software under Ubuntu is a very simple thing, just need a command to do it, Under Terminal, 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:
    <?php bloginfo ();?> (Note: When using the Bloginfo to Phpinfo, because the server limit, cannot use the Phpinfo function)
then save the file, enter the http://127.0.0.1/phpinfo.php in the browser, If a page appears with PHP running parameters, it means that PHP is working correctly.

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/ In the mods-enabled/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!

Those years studying together PHP (i)

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.