It is currently Wed Jun 19, 2013 9:37 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [HOWTO] Php, Apache, and Mysql
PostPosted: Wed Mar 15, 2006 6:59 pm 
Experienced Zenwalker
Experienced Zenwalker

Joined: Sat Mar 11, 2006 2:36 am
Posts: 119
Location: Valdosta, Georgia
PHP, Apache, and Mysql HOWTO

PHP (5.1.2 at the time of writing)

First open up a terminal then login as root.

Code:
username[~]$ su
Password:
root[username]#


Then use netpkg to download the latest version of PHP on the repository and install it.
Code:
root[username]# netpkg php
Checking for network connectivity, please wait...
Downloading dependency file
ddependencies : yes
Connecting to the packages repository...

[N] Found php-5.1.2-i486-2z22.tgz on the repository : not installed
 what should I do ?
1) install
2) download
3) skip


PHP is now installed.

Apache (2.2.0 at the time of writing)

Again we are going to use netpkg for installation.
Open a terminal and login as root if you are not root already.

Install Apache with netpkg.
Code:
root[username]# netpkg apache
Checking for network connectivity, please wait...
Downloading dependency file
ddependencies : yes
Connecting to the packages repository...

[N] Found apache2-2.2.0-i486-3z22.tgz on the repository : not installed
 what should I do ?
1) install
2) download
3) skip


First we need to make the apache startup script executable

As root:
Code:
chmod +x /etc/rc.d/rc.httpd


1) If you want apache to be able to use PHP edit /etc/apache/httpd.conf as root.
Change the the line at the very bottom of /etc/apache/httpd.conf that says:

Code:
# PHP support
#Include /etc/apache/mod_php.conf


to:
Code:
# PHP support
Include /etc/apache/mod_php.conf


Add index.php as a DirectoryIndex.

Code:
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>


Now it should be

Code:
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>


Now save the modifications to /etc/apache/httpd.conf.

Start the Apache webserver

As root:

Code:
/etc/rc.d/rc.httpd start


Note: Any changes you make to /etc/apache/httpd.conf while the apache server is running, the changes will not take affect until the apache server has been restarted.

Mysql (5.0.19 at the time of writing)

Install mysql with netpkg

As root:
Code:
root[username]# netpkg mysql
Checking for network connectivity, please wait...
Downloading dependency file
dependencies : yes
Connecting to the packages repository...

[N] Found mysql-5.0.19-i486-1z24.tgz on the repository : not installed
 what should I do ?
1) install
2) download
3) skip


In the terminal (as root):

Code:
root[username]#su - mysql
/dev/pts/0: Operation not permitted
mysql[~]$


Now install the database
Code:
mysql_install_db


exit from the prompt

Code:
mysql[~]$ exit
logout
root[username]#


As root (after typing exit you should be root). We are going to make the mysql script executable.

Code:
chmod +x /etc/rc.d/rc.mysqld


Start the mysql server

Code:
root[username]# /etc/rc.d/rc.mysqld start


You should see this:

Code:
root[username]# Starting mysqld daemon with databases from /var/lib/mysql


the terminal will stay like this. You can get a prompt back by typing CTRL-C.
Note: The mysql server will not stop. It is still running.

Now create a root password for mysql:

Code:
mysqladmin -u root password 'new-password'


An example of the root password for mysql:
Code:
root[username]# mysqladmin -u root password zenwalk



PHP, Apache, and Mysql should be installed and working properly with each other.


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Sun Feb 17, 2008 12:49 am 
Regular Zenwalker
Regular Zenwalker
User avatar

Joined: Sun Jan 06, 2008 4:35 am
Posts: 98
Location: Great Lakes region, North America
Working with Zenwalk 5.0, Apache 2.2.6, mysql 5.0.51, and php 5.25 I have found that in order for php to recognize mysql, a line in the 'Dynamic Extensions' section of /etc/apache/php.ini:
Code:
;   extension=msql.so

must be edited to read:
Code:
   extension=mysql.so

It is important to note that it needs to have the 'y' added as well as being uncommented.

[edit: newer PHP packages should have this line with 'mysql' by default, so it only needs to be uncommented.]


In addition to this fiacobelli, working with Zenwalk 4.0, advises
Quote:
Also, if you want to be able to send emails via Php, type, as root:

Code:
pear install Mail


this will enable you to use Mail.php, which is very standard.


Last edited by Don Coyote on Tue Jun 17, 2008 4:51 pm, edited 1 time in total.

 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 3:27 pm 
Regular Zenwalker
Regular Zenwalker

Joined: Tue Apr 15, 2008 5:43 pm
Posts: 39
Location: Portugal
I followed this tutorial from the beginning to the end ... And everything worked well ... or almost.

When I install joomla says he does not have the support available to MySQL ... How to solve this?

I do not understand this ... It says it has installed MySQL 5.0.62, I sign into phpmyadmin, only when I install something that needs MySQL says it is not installed ... ::)

I need help...

_________________
PC: AMD 2400+ | 1GB DDR | 40GB IDE | GeForce FX5200
Distro: Zenwalk 5.0 | Kernel: 2.6.24.2 | DE: Gnome

In my thoughts: Linux is not for those who can, it is for who want! \!D/


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 4:12 pm 
Zenwalk Spin-offs
Zenwalk Spin-offs
User avatar

Joined: Sat Aug 19, 2006 10:52 pm
Posts: 614
Location: Annecy, FRANCE
Hi,

Activate mysql support in php : edit /etc/apache/php.ini :
Code:
; To activate MySQL support, uncomment this ligne :
extension=mysql.so

(uncomment the second line)

Son|c


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 4:14 pm 
Regular Zenwalker
Regular Zenwalker

Joined: Tue Apr 15, 2008 5:43 pm
Posts: 39
Location: Portugal
Ok. Done!

Thanks man!!

_________________
PC: AMD 2400+ | 1GB DDR | 40GB IDE | GeForce FX5200
Distro: Zenwalk 5.0 | Kernel: 2.6.24.2 | DE: Gnome

In my thoughts: Linux is not for those who can, it is for who want! \!D/


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 5:27 pm 
Experienced Zenwalker
Experienced Zenwalker
User avatar

Joined: Sun Feb 04, 2007 11:06 am
Posts: 136
Location: Corfu, Greece
nice guide, only the necessary stuff, good explanation and everything works fine. :)

_________________
The obvious solution is probably the right one


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 5:31 pm 
Regular Zenwalker
Regular Zenwalker

Joined: Tue Apr 15, 2008 5:43 pm
Posts: 39
Location: Portugal
uupppssss, another problem ...

When I install the joomla for example, after entering the data (user, password, database_name), I do "next" and the system tells me that the user and password are wrong, something that is not true ...

_________________
PC: AMD 2400+ | 1GB DDR | 40GB IDE | GeForce FX5200
Distro: Zenwalk 5.0 | Kernel: 2.6.24.2 | DE: Gnome

In my thoughts: Linux is not for those who can, it is for who want! \!D/


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 5:54 pm 
Zenwalk Spin-offs
Zenwalk Spin-offs
User avatar

Joined: Sat Aug 19, 2006 10:52 pm
Posts: 614
Location: Annecy, FRANCE
By default, Apache runs as 'daemon' under Zenwalk.
I gave Joomla a try and used this user instead of the 'nobody' user that was provided as an example and it seems to be ok. Can you try with this one ? (in databases privileges commands as well as in Joomla install).

Son|c


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 6:26 pm 
Regular Zenwalker
Regular Zenwalker

Joined: Tue Apr 15, 2008 5:43 pm
Posts: 39
Location: Portugal
Thanks!!

Now, everything works.


8)

_________________
PC: AMD 2400+ | 1GB DDR | 40GB IDE | GeForce FX5200
Distro: Zenwalk 5.0 | Kernel: 2.6.24.2 | DE: Gnome

In my thoughts: Linux is not for those who can, it is for who want! \!D/


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Tue Jun 17, 2008 7:12 pm 
Zenwalk Spin-offs
Zenwalk Spin-offs
User avatar

Joined: Sat Aug 19, 2006 10:52 pm
Posts: 614
Location: Annecy, FRANCE
Great :)

It would be good to refresh this how-to and why not add the Joomla section ?

Son|c


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Wed Jun 18, 2008 3:34 pm 
Experienced Zenwalker
Experienced Zenwalker
User avatar

Joined: Sun Feb 04, 2007 11:06 am
Posts: 136
Location: Corfu, Greece
Son|c wrote:
Great :)

It would be good to refresh this how-to and why not add the Joomla section ?

Son|c

and then drupal and mambo etc....

_________________
The obvious solution is probably the right one


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Wed Jun 18, 2008 3:41 pm 
Regular Zenwalker
Regular Zenwalker

Joined: Tue Apr 15, 2008 5:43 pm
Posts: 39
Location: Portugal
he only problem that I had to not install the Joomla, it was because I had not uncommented the line in php.ini

When did this, now could install Joomla, Mambo ...

_________________
PC: AMD 2400+ | 1GB DDR | 40GB IDE | GeForce FX5200
Distro: Zenwalk 5.0 | Kernel: 2.6.24.2 | DE: Gnome

In my thoughts: Linux is not for those who can, it is for who want! \!D/


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Wed Jun 18, 2008 4:10 pm 
Experienced Zenwalker
Experienced Zenwalker
User avatar

Joined: Sun Feb 04, 2007 11:06 am
Posts: 136
Location: Corfu, Greece
and drupal doesn't need anything extra terrestrial, so imho we don't need to write a howto.
if after someone has a problem with these, i'm willing to answer.

ps imho this guide should be in the wiki as well, if it isn't already...

_________________
The obvious solution is probably the right one


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Wed Jun 18, 2008 4:47 pm 
Zenwalk Spin-offs
Zenwalk Spin-offs
User avatar

Joined: Sat Aug 19, 2006 10:52 pm
Posts: 614
Location: Annecy, FRANCE
I was only speaking about the versions of packages that are used in the tutorial (apache, mysql, php) , which have evolved and whose install is a little bit different now ...

Son|c


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Php, Apache, and Mysql
PostPosted: Wed Jun 18, 2008 5:12 pm 
Regular Zenwalker
Regular Zenwalker
User avatar

Joined: Sun Jan 06, 2008 4:35 am
Posts: 98
Location: Great Lakes region, North America
I've updated my addendum post since Son|c fixed that part of the PHP package. I'll be reinstalling all of these packages from scratch under 5.2 soon and will write a howto for the wiki as I go. I just need to figure out what's wrong with my wifi before I start on that...


Last edited by Don Coyote on Thu Jun 19, 2008 2:50 am, edited 1 time in total.

 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


 Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
 
cron