Environment setup
Software:
xampp Download address: https://www.apachefriends.org/zh_cn/index.html (It is recommended to use Thunder to download, otherwise the speed may be unbearable)
1. Installation
After installation, open it and see the following:
2. Start the service
Start apache Mysql service
3. Access address
Enter in the browser: http://127.0.0.1/xampp/splash.php
See the following interface: It means that the PHP environment has been set up
Write helloworld:
Go to your installation path: (I installed it on the D drive)
Open the folder and see
The php language is placed in the htdocs directory by default:
Go to the htdocs folder and create a new file helloworld.php
Open the helloworld.php file and enter the following code:
Copy code The code is as follows:
echo "helloworld,"; //Output string helloworld
echo "this is my firstphp script."; //Same as above
echo phpinfo(); //phpinfo() is a system function that outputs php environment information
?>
Open the address bar and enter: 127.0.0.1/helloworld.php
See the following screen:
This is your first helloworld.