Question: How to Install Php on Ubuntu?
Contents

A non-root user that can perform sudo tasks.

  • Step 1: Install Apache. Ubuntu 18.04 maintains a central repository where you can install most applications from using the apt command.
  • Step 2: Install MySQL. Run the command below on the terminal window to install MySQL server on your Ubuntu 18.04 VPS.
  • Step 3: Install PHP.

How do I download and install PHP on Ubuntu?

How to Install Apache, MySQL and PHP on Ubuntu 17.04

  1. Step 1: Install Apache. First, update your package manager.
  2. Step 2: Install MySQL. Enter this into the shell prompt.
  3. Step 3: Install PHP. Next, let’s install PHP.
  4. Step 4: Start Apache and MySQL on boot. This is necessary to start your web environment on boot.

How do I start PHP in Ubuntu?

Open a terminal and type this command: ‘ gksudo gedit /var/www/testing.php ‘ (gedit being the default text editor, others should work too) Enter this text in the file and save it: <?php phpinfo(); ?> Restart the php server using this command: ‘ sudo /etc/init.d/apache2 restart ‘

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest