You are not logged in.

#1 2003-09-28 07:35:39

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 546
Website

How to set up a PHP/mySQL "server" in arch?

Hi,

I know its a wide question, and i may have to go to different howtos and such, but as this distro is different from the others there might be some differences in that.

If i want to run a PHP based site in mozilla and the site is hosted in my machine, do i need to do something real strange to make it work ?

if you can post any link to some info, it wont hurt. and yes i will google anyway!


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

#2 2003-09-28 10:52:42

DanEE
Member
From: Fribourg, Switzerland
Registered: 2003-07-10
Posts: 43

Re: How to set up a PHP/mySQL "server" in arch?

I played around lately with those things.

I found out that I could start mysql only if I changed the /var/lib/mysql directory to the user mysql. If I didn't do that I couldn'd start "mysqld start" at all it just gave my some error messages.
I don't know if that's normal behaviour though but I really played around quite a long time to find that out. I nearly gave up...

For the apache, I used the apache howto wich red_over_blue wrote in the documentation forum. It worked so far. But I just quickly testet it and I don't plan to maintain a server...

Offline

#3 2003-09-28 12:35:08

rasat
Forum Fellow
From: Finland
Registered: 2002-12-27
Posts: 2,296
Website

Re: How to set up a PHP/mySQL "server" in arch?

sud_crow wrote:

If i want to run a PHP based site in mozilla and the site is hosted in my machine, do i need to do something real strange to make it work?

I am running Apche/PHP/MySQL on my machine and simple to setup. Few things requires to know. It can be done in different way. This is how I do including how to test the server(s). Host name is: "localhost". If anything is missing, please let me know.

<b>INSTALL:</b>
pacman -S apache
pacman -S php
pacman -S mysql

<b>APACHE:</b>
<b>1. </b>Add the following line in /etc/httpd/conf/httpd.conf :

LoadModule php4_module /usr/lib/apache/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php

<b>2.</b> Add line in /etc/host :

127.0.0.1  localhost.localdomain    localhost

<b>3.</b> Edit /etc/rc.conf :

#
# Networking
#
HOSTNAME="localhost"

<b>4.</b> Run in terminal (root):
# /etc/rc.d/httpd start

<b>5.</b> Edit /etc/httpd/conf/httpd.conf (close "AddModule mod_php4.c"):

LoadModule php4_module /usr/lib/apache/libphp4.so
# AddModule mod_php4.c
AddType application/x-httpd-php .php

<b>6.</b> Add line in /etc/rc.local (to start at boot):

/etc/rc.d/httpd start

<b>Test</b> Apache:
http://localhost/

<b>PHP:</b>
<b>1.</b> Edit /usr/etc/php.ini (open the mysql extension):

extension=mysql.so

Test PHP with a simple script:

<html>
This is a test. Say hello to Arch:
<p>
<body>

<?php
$myvar = "Hello Arch Linux";
echo $myvar;
?>

</body>
</html>

Save the file as "test.php" and copy to /home/httpd/html/

<b>Test</b> PHP:
http://localhost/test.php

<b>MySQL:</b>
<b>1.</b> Run in terminal:
# /etc/rc.d/mysqld start

<b>2.</b> Add line in /etc/rc.local (to start at boot):

/etc/rc.d/mysqld start

<b>Test</b> MySQL
Run in terminal (don't enter any password):
# mysql -p

<b>Note:</b> Change the /var/lib/mysql directory to user "mysql" if not getting MySQL to run.

<b>For more information</b> (if new in PHP/MySQL):
http://hotwired.lycos.com/webmonkey/99/21/index2a.html


Markku

Offline

#4 2003-09-29 16:48:17

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: How to set up a PHP/mySQL "server" in arch?

You can email them to Dennis, if you like.  His email addy is on the Developer page.

Offline

#5 2003-09-29 17:52:38

ianneub
Member
From: HB, CA, USA
Registered: 2003-09-03
Posts: 25
Website

Re: How to set up a PHP/mySQL "server" in arch?

Rasat: With the new apache 2 in the official repository you no longer need to include the 3 lines in httpd.conf to make php work. You just need to uncomment:

#LoadModule php4_module   lib/apache/libphp4.so

Thanks for the FAQ!


cool sig line

Offline

#6 2003-09-29 23:59:19

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 546
Website

Re: How to set up a PHP/mySQL "server" in arch?

Hi,

great mini-howto!

going to test it right now.


also, _ob1 could you post here the URL or send a PM to me too? i like reading in spanish from time to time lol


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

#7 2003-09-30 09:02:01

rasat
Forum Fellow
From: Finland
Registered: 2002-12-27
Posts: 2,296
Website

Re: How to set up a PHP/mySQL "server" in arch?

ianneub wrote:

Rasat: With the new apache 2 in the official repository you no longer need to include the 3 lines in httpd.conf to make php work.

Thanks. Glad Apache did it. Surprise it was not done earlier when thousands of users around the world have been  using PHP since 1997.

http://sg.php.net/history


Markku

Offline

Board footer

Powered by FluxBB