Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Install PHP

Install the PHP Packages

sudo apt-get install php5

As of Ubuntu 12 (an maybe even earlier), the installer will automatically restart Apache2 for you.

Verify

Quickly verify that everything works by creating a php info file with your favourite editor,

sudo vi /var/www/info.php # On public site do not use such an obvious file name

Put in the following contents,

<?php
phpinfo();
?> 

Save the file and browser to file using a browser. You can use either the IP Address or the valid Domain Name. For example, http://173.194.75.94/info.php or http://www.krypton.com/info.php which should show a purple and grey PHP informational screen.

Secure the Server

suPHP, LiteSpeed Web Server

Install MySQL

sudo apt-get install mysql-server 

For the root administration database password, use the standard password algorithm based on the server name.

Connect PHP to MySQL

sudo apt-get install php5-mysql 

Create the Accounts in MySQL

Connect into MySQL,

mysql -u root -p 

Enter the following MySQL commands,

CREATE DATABASE wordpresskryptondb;
GRANT ALL PRIVILEGES ON wordpresskryptondb.* TO "wpkryptonuser"@"localhost" IDENTIFIED BY "password";
FLUSH PRIVILEGES;
EXIT

Explain variables on a table, wordpresskryptondb, wpkryptonuser, localhost, password.

FAQ

Why do some of the php5 installations say to use install libapache2-mod-php5?

No need, it is included with the php5 package.

What is the difference between the php5  and libapache2-mod-php5 packages?

Nothing I can see. It just looks like php5 is an overarching package name.

References

Ubuntu Server Documentation - https://help.ubuntu.com/12.04/serverguide/php5.html

Has some ok details around suPHP - https://help.ubuntu.com/community/ApacheMySQLPHP#Installing_MYSQL_with_PHP_5

  • No labels