Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 06-16-2006, 09:44 AM   #1
LQ Newbie
Registered: Feb 2006
Posts: 24

Rep: Reputation: 15
Post How I setup Apache,Mysql,PhP on Slack 10.2

Hi all,
Im new to linux and slackware.
Recently I have setup php,mysql and apache on my slackware 10.2 machine. I have written this step-by-step guide in the hope that it will help other newbies. I hope you find it informative.

At the bottom of this guide are some steps on testing apache,mysql and php.

I started by installing the packages with the cd during the installation of slackware.

Note: If you haven't installed the packages before hand simply download the packages linked below and type "installpkg packagename" instead of "updatepkg".

I wanted to upgrade to the latest versions so I downloaded packages from the following urls: php, mysql and apache

I then went into the console and browsed to the directories I had downloaded them to using cd.

As root. I then installed all 3 packages by typing: upgradepkg packagename

After I had installed all 3 packages I stoped apache by typing into the console: apachectl stop

I then typed into the console: locate httpd.conf (Skip the bold part if you found it)

Note: To find httpd.conf you may first need to Create slocate database

To do this simply type: locate -u (This will create the slocate database in whatever folder you happen to currently be in.

Now type updatedb In the console to update the database.
and then type: locate httpd.conf

Now edit httpd.conf using Kwrite or a similar program.

Search inside the file for "LoadModule rewrite_module lib" (hit ctrl + f to search).

Underneath this line type: LoadModule php5_module /usr/lib/apache2/

The directories above just happens to be were my "" file happens to be. Type in console: locate

That will tell you were your file is.

Now search the file (ctrl +f) for "AddType application/x-gzip"
Underneath this line add the following two lines: AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

Save httpd.conf

Now go back into console and type: apachectl start

PHP and Apache should now be working.

Now go into console. Type: su mysql (I am assuming that slackware created this account) If the user doesn't exist type man useradd and groupadd for info on adding users.

Note: It is important that you log in as mysql for this part.

Now locate mysql_install_db then browse to the folder in the console. Then type mysql_install_db

Then log back in as root using su root

Type in console: chown -R mysql:mysql /var/lib/mysql

This gives mysql user and mysql group owner rights to the folder.

Note: Your folder may be at a different location. Simply locate ibdata1 to find the correct folder.

Now locate rc.mysqld

On my hard drive it is located in: /etc/rc.d/

Now type into console: /etc/rc.d/rc.mysqld start (substitute etc/rc.d/ with were it is located on your computer).

Apache - Simply start apache by typing "apachectl start"
Then go into your web browser and type "localhost" if apache works you will see a html page telling you so.

PHP - After editing httpd.conf you need to restart apache. locate htdocs folder and open up kedit. Type <?php phpinfo(); ?> save the file in the htdocs folder as phpinfo.php then open up your web browser. Type http://localhost/phpinfo.php If PHP is working then a whole lot of information will be printed in your browser with a purple php header.

Mysql - To check that mysql is working simply type: mysql
into the console. If it works the following will print out:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.22-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Hopefully PHP, MySQL and Apache is now working on your computer.

Thankyou to all those people who helped me (Bread, Davus, Johno and Alex) setup php,mysql and apache and thankyou for all your patience.

Last edited by Tiepo; 06-18-2006 at 01:12 AM.
Old 06-16-2006, 10:01 AM   #2
Registered: Mar 2005
Location: UK
Distribution: Slackware
Posts: 794
Blog Entries: 2

Rep: Reputation: 30
Two typos.

"As root. I then installed all 3 packages by typing: installpkg packagename"

To upgrade a package you use upgradepkg


"Now type updateb In the console to update the database."

Sould be updatedb .

Last edited by simcox1; 06-16-2006 at 10:04 AM.
Old 06-16-2006, 10:31 AM   #3
LQ Newbie
Registered: Feb 2006
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks for that
Old 06-16-2006, 01:05 PM   #4
LQ Newbie
Registered: Feb 2006
Posts: 1

Rep: Reputation: 0

Thanks for the guide
Old 06-16-2006, 07:00 PM   #5
LQ Veteran
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
Please consider submitting this as a Linux Answer. As a thread, it will tend to get lost, while a tutorial lives on
Old 06-18-2006, 01:34 AM   #6
LQ Newbie
Registered: Feb 2006
Posts: 24

Original Poster
Rep: Reputation: 15
Good idea. I have submitted it to linux answers j.w
Old 06-25-2006, 03:51 PM   #7
Registered: Jul 2005
Location: Bulgaria [Sofia city], bukston city[neighbourhood]
Distribution: Linux Slackware 10.2 [k]
Posts: 41

Rep: Reputation: 15
Great i've just done it but with the apache,php & mysql from the slackware 10.2 distro all work ... resuming normal operations :P :P :P


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL and Apache server setup nenyo Linux - Software 7 02-12-2005 01:48 PM
Apache/PHP/MySQL Setup Help jobless_joe Linux - Software 2 05-30-2004 01:55 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
Apache PHP MySQL Setup after Slackware 9.0 Installation initself Slackware 37 12-20-2003 06:48 AM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 06:23 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration