You are not logged in.
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
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
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
You can email them to Dennis, if you like. His email addy is on the Developer page.
Offline
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
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
Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux
Offline
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.
Markku
Offline