Setting up PHP and MySQL

Support for webhosts that use CentOS
Xaroth
Posts: 8
Joined: 2008/01/25 15:53:40

Setting up PHP and MySQL

Post by Xaroth » 2008/01/25 16:01:38

I am new to CentOS - and to using Linux OS's as servers altogether, actually.

I am currently looking to set up a closed-network apache server running php and mysql. Apache comes installed and set up in the default server package. But aparently PHP and MySQL are in the CentOSPlus repository. How would I go about installing PHP and MySQL from this repository?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Setting up PHP and MySQL

Post by gerald_clark » 2008/01/25 16:21:15

PHP and MySQL are on the CentOS DVD, and in the CentOS repositories.
Just use yum to load them.

yum groupinstall 'MySQL Database'
yum install php
yum install php-mysql

Xaroth
Posts: 8
Joined: 2008/01/25 15:53:40

Re: Setting up PHP and MySQL

Post by Xaroth » 2008/01/29 15:33:07

I do not have an internet connection to the box being used as a server - and will not be able to get one. So I'll have to get the install from the DVD.
The commands you listed tried to no avail to install from the online repository.

How would I go about installing from DVD?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Setting up PHP and MySQL

Post by gerald_clark » 2008/01/29 15:47:28

man yum

Mount your DVD at /media/cdrom

yum --enablerepo=c5-media groupinstall 'MySQL Database'
yum --enablerepo=c5-media install php
yum --enablerepo=c5-media install php-mysql

Xaroth
Posts: 8
Joined: 2008/01/25 15:53:40

Re: Setting up PHP and MySQL

Post by Xaroth » 2008/01/29 16:23:54

Enabling "c5-media" does not appear to be enough.
I do not have an internet connection. Trying to run "groupinstall....." with c5-media enabled still errors because it still tries to connect to online repositories. On failing to connect, it quits trying. Doesnt go on to check the c5-media repository, which I assume checks the mounted DVD..

So I tried --disablerepo=extras and --disablerepo=updates
And it still erroed on a repo called "os" (for the same no connectivity error)
When I disabled the "os" repo, the installation failed on trying to load the "installonlyn" plugin.

Aparently CentOS (and all other Linux-based OS I have tried) update and manage software installation through online repositories. This has so far proven to be a huge problem for me, as it is very difficult to manage software without an internet connection.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Setting up PHP and MySQL

Post by gerald_clark » 2008/01/29 16:54:26

There is no "os" repo, and the c5-media repo works.
You can try disabling all but the c5-media repo.

Mount your DVD at /media/cdrom

yum --disablerepo=* --enablerepo=c5-media groupinstall 'MySQL Database'
yum --disablerepo=* --enablerepo=c5-media install php
yum --disablerepo=* --enablerepo=c5-media install php-mysql

Xaroth
Posts: 8
Joined: 2008/01/25 15:53:40

Re: Setting up PHP and MySQL

Post by Xaroth » 2008/01/31 16:21:49

I did what you said to do (using a wildcard disablerepo) and the installs went through fine.

But now the httpd service will not start up.
Trying to start it results in a useless error message to the effect of "httpd failed. Reason: Starting httpd [FAILED]."

>_>

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Setting up PHP and MySQL

Post by gerald_clark » 2008/01/31 16:48:11

Check the logs in /var/log/httpd.

Xaroth
Posts: 8
Joined: 2008/01/25 15:53:40

Re: Setting up PHP and MySQL

Post by Xaroth » 2008/02/01 16:02:35

Fixed the error - thank you!

PHP at least appears to be working fine - I was able to run a simple PHP script successfully on a test web page. :)
If I run into problems with MySQL I'm sure I'll be back. Until then - thanks again.

Xaroth
Posts: 8
Joined: 2008/01/25 15:53:40

Re: Setting up PHP and MySQL

Post by Xaroth » 2008/02/07 16:06:23

Alright - aaaaaaaaand I'm back.
Ran into a rather basic problem with MySQL... it isnt installed.

I didnt think anything of it at the time, but on trying to "groupinstall 'MySQL Database'" and "install php-mysql", a warning about not having a public key for one of the .rpm files that would have otherwise installed was shown. Aparently after displaying the warning, the installer crapped out completely and refused to move on.

Now what?

(The "install php" went through fine, at least)

Post Reply

Return to “CentOS 5 - Webhosting Support”