This is a quick tutorial for installing, Apache2, PHP5, PHP Modules, MySQL5, PhpMyAdmin and SSH Remote Access on Linux Ubuntu 14. Probably for many version of Ubuntu or different Linux release will work.
Install MySQL 5
1 |
$ sudo apt-get install mysql-server mysql-client |
set the passwords in the install menu.
Install Apache2
1 |
$ sudo apt-get install apache2 |
Check on the browser with http://127.0.0.1
if you see:
Install PHP5
1 2 3 |
$ sudo apt-get install php5 libapache2-mod-php5 $ sudo service apache2 restart |
Default page is located in /var/www/html/index.html
Add a php info page to test php installation.
1 |
$ sudo nano /var/www/html/info.php |
This will create new php file called info.php in default server http directory. Write this simple code to see if it's interpreting by PHP engine.
1 2 3 |
<?php phpinfo(); ?> |
Check on browser with http://127.0.0.1/info.php You should see a page similar to this:
Install PHP5 Modules
Default PHP installation doesn't contain some useful modules. Search all of them with:
1 |
$ sudo apt-cache search php5 |
And install the modules you want like this syntax:
1 2 3 |
$ sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl $ sudo service apache2 restart |
Install PhpMyAdmin
1 |
$ sudo apt-get install phpmyadmin |
In the configuration options select "Web server to reconfigure automatically" to do it for Apache2
Even though everything seems OK, in the PhpMyAdmin panel bottom of the page you can see some message like " mcrypt is not configured " to fix this use module installer below.
1 2 3 4 5 6 7 8 9 |
# If PhpMyAdmin gives mcrypte error? Install and configure with this commands # install the extension $ sudo apt-get install php5-mcrypt # you can see that it's installed by the presence of the .ini file $ cat /etc/php5/mods-available/mcrypt.ini # enable it $ sudo php5enmod mcrypt # reload Apache to make use of the extension $ sudo service apache2 reload |
Enable SSH For Remote Access
1 2 3 4 5 6 7 8 |
# install $ sudo apt-get install openssh-server # config (optional) $ sudo gedit /etc/ssh/sshd_config # restart $ sudo /etc/init.d/ssh restart |