PHP Installation
What Do You Need to Do?
To start using PHP, you can:
- Find a web host that supports PHP and MySQL
- Install a web server on your own PC, then install PHP and MySQL
Using a Web Host with PHP Support
If your server supports PHP, you don't need to do anything.
Simply create .php files in your web directory, and the server will automatically parse these files for you.
You don't need to compile any software or install additional tools.
Since PHP is free, most web hosts provide support for PHP.
Setting Up PHP on Your Own PC
However, if your server does not support PHP, you must:
- Install a web server
- Install PHP
- Install a database, such as MySQL
The official PHP website (PHP.net) has installation instructions for PHP: http://php.net/manual/en/install.php
PHP Server Components
For beginners, it is recommended to use integrated server components, which already include services like PHP, Apache, and MySQL, saving developers from spending time on tedious configuration processes.
WampServer
Windows users can use WampServer, download link: http://www.wampserver.com/, which supports both 32-bit and 64-bit systems, choose the version according to your system.
WampServer is easy to install; you just need to keep clicking "Next" to complete the installation.
XAMPP
XAMPP supports Mac OS and Windows systems, download link: https://www.apachefriends.org/zh_cn/index.html.
IDE (Integrated Development Environment)
Eclipse for PHP (Free)
Eclipse is an open-source, Java-based extensible development platform (if JDK is not installed, you need to download JDK first). By itself, it is just a framework and a set of services for building development environments through plug-ins. Fortunately, Eclipse comes with a standard set of plug-ins, including Java Development Tools (JDK).
Supports Windows, Linux, and Mac OS platforms.
Eclipse for PHP official download link: http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliosr
PhpStorm (Paid)
PhpStorm is a lightweight and convenient PHP IDE, designed to provide user efficiency, deeply understanding user coding, offering smart code completion, quick navigation, and instant error checking.
PhpStorm is highly suitable for PHP developers and front-end engineers. It provides features such as smart HTML/CSS/JavaScript/PHP editing, code quality analysis, version control integration (SVN, GIT), debugging, and testing.
Supports Windows, Linux, and Mac OS platforms.
PhpStorm official download link: http://www.jetbrains.com/phpstorm/download/
Running PHP Programs in Cloud Studio
>
PHP is an open-source, interpreted, and object-oriented scripting language that runs on the server-side. Being an interpreted language, it does not require compilation, making it faster than other languages for scripting. With features like open-source, platform independence, compatibility, and embedded scripting, PHP is increasingly being used for web development. Most of the time, server-side PHP scripts rely on web servers like Apache or Nginx to run. However, here I recommend a more convenient development environment: using the online cloud-based development tool Cloud Studio based on Tencent Cloud + PHP's built-in web server to quickly start your PHP project.
- Step 1: Visit the Tencent Cloud Developer Platform and register/log in to your account.
Step 2: Select the
"PHP Runtime Environment"
from the runtime environment menu on the right.Step 3: Create a new PHP code directory in the code directory on the left and write your PHP code.
Step 4: Navigate to the PHP code directory and run
php -S 0.0.0.0:8080
to start the PHP built-in web server listening on port 8080.Step 5: Click on the [Access Link] tab on the far right, fill in the port number as 8080 in the access link panel, click to create a link, and then click the generated link to access our PHP project.
Tips: From the terminal commands, you can see that Cloud Studio integrates a development environment of Ubuntu 16.04.1 + PHP 7.0.28 (NTS):
For any questions, you can refer to the Help Documentation.
Currently, CODING is hosting a "My Favorite Cloud Studio Plugin Contest" based on Cloud Studio workspaces. Visit the event website for more information.