Logicalwebhost Cheatsheet

Linux & Open Source Cheatsheets & Howto's

Skip to: Content | Sidebar | Footer

php howto

PHP is really versatile, but mostly used in websites where you want to use dynamic data, like from a mysql database and then display it as html in a browser. Nowadays most people use php5, which you can install like:

apt-get install php5

if you want to know what options are enabled after that (in your /etc/php5/apache2/php.ini) from command line do:

php -i | less

If you want to code php on your computer, you can use something like Eclipse, which is really great and free, but can be pretty confusing, and you still may have to upload it to a server to get it run, usually with FTP, so hopefully that’s installed on your server where your website is uploaded to.

Php has to be enabled on your webserver too, usually with apache2 (or nginx). You can make sure it’s enabled by installing:

apt-get install libapache2-mod-php5