Debian – PHP, MySQL, Apache2

computer-server
This article is a walkthrough on installing PHP environment – PHP, Apache, MySQL and xDebug on Debian.

When it comes to database servers, there are several free database server applications available. The intended use of the database server will have some impact on which database package you choose. MySQL is the most widely used free database server. However, it’s use is primarily to act as a back end database for Web site applications written in embedded scripting languages like PHP because it doesn’t support things like triggers, stored procedures, and replication (yet).

Open a terminal. You will need to install all the parts as root, so… suit up!

Install Apache web server

apt-get install apache2

Install MySQL server

apt-get install mysql-server


Install PHP 5

apt-get install php5

Install MySQL extension for PHP

apt-get install php5-mysql

Install xDebug extension for PHP – the extension for debugging.

apt-get install php5-xdebug

This all what you have to install. Now we will set up Apache and PHP.

After installing Apache the server should be running. If you click this link http://localhost/ the Firefox is opened and you should see a page with the text “it works!”.

Enable remote debugging in xDebug

In the folder /var/www/ create an info.php file with content with the property tags:

phpinfo();

Hit http://localhost/info.php and you should see how the PHP runtime is setup. Search for the property xdebug.remote_enable property. By default this property is switched off.

To enable this property you have to open file /etc/php5/conf.d/xdebug.ini and add this line:
xdebug.remote_enable=on

and restart the Apache web server

/etc/init.d/apache2 restart
Advertisements

One response to this post.

  1. […] DaniWeb IT Discussion Community – Software Programming / Web Development and Technical Support wrote an interesting post today on Debian – PHP, MySQL, Apache2Here’s a quick excerptIf you click this link http://localhost/ the Firefox is opened and you should see a page with the text “it works!”. […]

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: