Ubuntu - installing Apache and PHP5 with MySQL support
apt-get install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
done!
Now that we have Apache installed, we can move onto installing PHP. If you don’t require PHP then please feel free to skip.
PHP5 Install
In this example, I’m not going to install all the modules available. Just some common ones.
To see what modules are available try a:
apt-get search php5-
Note the ‘-’ at the end of ‘php5′. This will show any packages that start with ‘php5-’ and shows the available modules.
Due to using apt-get to install PHP5, any dependencies are taken care of:
This will install php with mysql support:
apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd \
php5-imagick php5-mcrypt php5-memcache php5-mhash php5-mysql php5-pspell php5-snmp \
php5-sqlite php5-xml php5-xsl
Once done, do a quick Apache reload:
/etc/init.d/apache2 reload
Done!
9 Replies
Just a couple of corrections:
@routermods:
apt-get search php5-
That should be apt-cache search php5-
@routermods:
php5-xml
That should be php5-xmlrpc
And unless you'll be connecting to an external MySQL server, it's probably a good idea to include apt-get install mysql-server mysql-client in your tutorial as well. Most newbies are going to need it anyway. Perhaps even apt-get install phpmyadmin (but only if you want to keep your web root at /var/www, because that's where Ubuntu installs phpmyadmin by default.)
phpMyAdmin default Apache configuration
Alias /phpmyadmin /usr/share/phpmyadmin
DirectoryIndex index.php
Authorize for setup
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup
For Apache 2.2
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup
Require valid-user
phpflag magicquotes_gpc Off
phpflag trackvars On
phpflag registerglobals Off
phpvalue includepath .
phpflag magicquotes_gpc Off
phpflag trackvars On
phpflag registerglobals Off
phpvalue includepath .
I do however suggest changing the alias from phpmyadmin to anything else…..(security)
Install it with
sudo apt-get install php-pear
If you don't like binaries, you can always get the latest version of the PEAR extensions here
PECL
After installing PECL, you can install APC with
sudo pecl install apc
http://www.routermods.com
here