Deployment and HelloWorld of "PHP" native development environment

Source: Internet
Author: User
Tags configuration php php server php database php development environment php write dreamweaver
Deployment and HelloWorld of the "PHP" Local development environment

Build PHP development environment In fact, the difficulty and JSP equivalent, MySQL database, Apache server, a series of cumbersome manipulation,

However, for PHP, there are some good integration components on the network, so that PHP beginners can quickly get started,

And more than one, easyphp and so many, the following recommended the use of Phpnow, one-click Installation,


First, the construction and deployment of PHP Local development environment


First on Phpnow's official website (click Open link) to download phpnow1.5.6, although the official website a little advertising, but it is a conscience,

After downloading the phpnow-1.5.6.zip extract to your favorite folder, this directory must be selected, the future of the PHP server, the development program is rooted here, can not be moved


Get the file that looks like this:


Click Setup.cmd to start the installation,

Start will ask the Apache version and MySQL version, in fact there is no big difference, enter 20 and 50 respectively, the default recommended version installation can be


After a series of file decompression process, waiting for the file to be extracted,

Will ask the user to initialize PHP, directly enter Y press ENTER to


After that, if your 80 and 3306 ports are already in use, you can exit the installation after you set up your MySQL password, and Phpnow will automatically create the test database after installation.

If your 80 port and 3306 segment ports are already in use, just like on the author's machine if the other development programs are already pulled on the two ports, you will be prompted to change the port's query information:


HTTP port to get rid of no problem, enter a number you like, such as I like 7777, enter 7777, after debugging PHP page after the URL to pull this port number can be

MySQL port number do not change, the author has done the experiment, after the change is problematic, the machine best without MySQL, if the machine already has MySQL can take the following methods:

First back up your MySQL database to. sql file, then give a port number to Phpnow to install MySQL, then press ENTER, continue to install, enter the password end installation

Open the Stop.cmd (path such as: D:\Program files\php\pncmds\ in Pncmds under the Phpnow root directory Stop.cmd) with absolute Force Uninstall. cmd, the PHP uninstall, restart the computer, and then repeat the above steps, reinstall Phpnow, and then the original MySQL database restore, then there is no problem, just your MySQL database version downgrade to 5.0, temporarily did not see what impact, anyway I The original Javaweb project hangs in the MySQL database after this can still use normally,

However, it is recommended to develop PHP and JSP as much as possible on different machines or using different virtual machines ...


Second, test build and deployment is successful


1. Directly in any browser input: http://localhost:7777/index.php, just did not prompt port conflict, remove: 7777 direct http://loclhost/index.php can, the same,

And in the MySQL user password field to enter the MySQL password you just set, then display the following information:


Because the author has changed the Apache Port of PHP and forced PHP and JSP to use the same port at the same time the database, so may cause eaccelerator failure,

But whatever it is, because eaccelerator is just a an overall picture accelerator that makes PHP code more efficient to execute .


2. Again in the browser address bad input: http://localhost:7777/phpmyadmin/ index.php input MySQL user name, is generally root, and password, is you just set the MySQL password point execution, get the following PHP database graphical management screen, the PHP database configuration is successful, click Exit, you can finally happily develop PHP!



Third, PHP's HelloWorld


What does PHP write with? Someone recommended tools such as Phpdesigner

In fact, this is not necessary,

want to vbscript,asp using Notepad to write to Dreamweaver is no problem, so write the page in PHP's Htdocs directory, such as: D:\Program files\php\htdocs\ index.php, in fact, this index.php is what you just saw http://localhost:7777/index.php

The author is the following with Dreamweaver configuration PHP development environment,

In the case of Adobe Dreamweaver CS5, Dreamweaver 8 is not used, and dynamic code highlighting such as Asp,php,javascript is not supported.

First create a new myphp folder under Htdocs, then myphp is my project name, you can change to other

Create a new site in the DW, and then, specify the site directory is here, site name arbitrarily, anyway site name is only the site in the DW alias


Direct point "Save"

Then enter the following code in the DW, in fact the most critical is the part between

 
  Untitled Document
 
  

After the ctrl+s is saved, the browser input http://localhost:7777/myphp/helloworld.php displays:


This is our first step in PHP!


Iv. Comparison of asp.net,jsp,php


In fact, after embedding dynamic code and Web page ASP into the drag control of ASP, PHP re-prop dynamic code mosaic and the banner of the Web page ~jsp is still unique to the SSH or servlet to put all the dynamic code embedded in the Java file,

This kind of dynamic code embedded in the Web page, some people say that will lead to code bad maintenance, the individual is actually better maintenance, after all, all the code in a file, do not go around, the key is to ask the program ape read through each piece of code is what.

At the same time, based on the dynamic code mosaic in the Web page, except the database that everyone needs, PHP development is just a simple server, even using the Windows comes with IIS to PHP can be completely no problem, but because there are already a large number of PHP integration software, So users can install it more easily with one click.

PHP so given the need for ASP. iis,visual Studio,sql server,jsp need to use the Eclipse/myeclipse (no, write Java program is too troublesome, especially when you use the framework of SSH, etc., Web. XML will write dead! More lightweight than Tomcat, only requires an outdated Dreamweaver or even Notepad to write, and there is no problem with low-profile computers running Visual Studio and Eclipse/myeclipse. At the same time, as with JSP, the front-end maintenance is simpler than ASP.



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