z
PHPfull name:Hypertext
Preprocessor, Chinese name: "Hypertext Preprocessor" is a general open source scripting language, mainly used for Web application development (commonly known as website or backend!), starting from 5.0 Support object-oriented, some words are omitted below...
1. Editing software:
PHPStorm
for mac
2, a useful PHP development tool.
2. Operating environment:
Running environment:XAMPP
for mac3 integrates the running environment of MySql and PHP.
After the installation is complete, start (sudo /Applications/XAMPP/xamppfiles/bin/mysql.server
start)
How to start writing code
1.First use PHPStormCreate a new project
2.Save the project in the specified directory
After the project is successful, it should be purple The
4.Create a new PHP file
in the project
5.Now we can write code
Add code in the new PHP file: echo "hello
PHP!";
6.Run the code
PHP The code needs a running environment to execute. The XAMPP we installed is an integrated environment for PHP development and operation.
Now we copy the project directory to XAMPP
In the htdocs directory of , professionals call this process "publish"(actually it is copy, as for where to copy, it depends on which server you have ), every time you modify the code, be sure to publish and check the results again.
The next moment to witness the miracle has arrived, enter in your browser:
http://ip address (localhost)/project name/PHP file name.php (if there is a folder, add the folder Name)
For example: http://localhost/MyFirst/Helloworld.php
PS: If the browser has not changed, please make sure you typed the address and hit Enter. PS:If it is garbled code, you can change the encoding or type:
PS:If it is an error
404, The path is wrong, please check the path you entered.
Okay, that’s it for now.
The above has introduced the introduction to PHP, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.