views

Make sure that your version of Ubuntu is up-to-date. As of August 2018, the most recent version of Ubuntu Linux is 18.04. You can check your version of Ubuntu by doing the following: Click Android 7 Dropdown, then click the tool icon in the drop-down menu. Click Details. Click the About tab. Check the version number next to the "Ubuntu" heading at the top of the window. Update if necessary by clicking Check for updates and following any on-screen prompts.

Open Terminal. Click the Terminal app icon, which resembles a black box, on the left side of the desktop. This will open the Terminal window. You can also just press Alt+Ctrl+T to open Terminal.

Tell Terminal to install PHP. Type the following code into Terminal, then press ↵ Enter: sudo apt-get install php

Enter your password when prompted. Type in the password you use to log into your computer, then press ↵ Enter. Neither your password nor stand-in characters will display in Terminal when you type.

Confirm the installation. Type in y when prompted, then press ↵ Enter. PHP will begin installing.

Verify that PHP installed correctly. Once you're able to type again, enter the following code: php -v

Look for a confirmation message. You should see a verification message inside Terminal that reads something like "PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: [date]) (NTS)". This confirms that PHP finished installing correctly.

Install common PHP modules if needed. If you're working with PHP in an environment that requires add-ons, you can install commonly used ones by entering the following code into Terminal and then pressing Y and pressing ↵ Enter: sudo apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php

Check for additional modules if you like. You can look up a list of available modules by entering the following code: apt-cache search --names-only ^php

Set PHP 7.2 as the default version. If you want to use PHP 7.2 as your computer's default version, do the following: sudo update-alternatives --set php /usr/bin/php7.2
Comments
0 comment