You are not logged in.

#1 2011-07-23 18:53:53

pcuser
Member
Registered: 2011-07-23
Posts: 6

Running Mysql With Apahce And PHP

hello I recently  installed apache php and mysql on my arch linux system, but mysql dosnt seem to be running with the apahce server. when I run the mysql command everything works find, I can run commands setup databases and all that, but It seems that I cannot connect to mysql via PHP. for example when I try to install joomla on my server It tells me that there is no mysql support. If mysql works fine when I use it through the command line why wont it work through PHP/web server? Thanks in advance

Offline

#2 2011-07-23 18:55:40

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: Running Mysql With Apahce And PHP

Make sure to have the needed mysql module loaded in php.ini.

Offline

#3 2011-07-23 18:55:56

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Running Mysql With Apahce And PHP

Is mysql support enabled in your php.ini?


ᶘ ᵒᴥᵒᶅ

Offline

#4 2011-07-23 19:03:12

pcuser
Member
Registered: 2011-07-23
Posts: 6

Re: Running Mysql With Apahce And PHP

How do I enable it? what line in php.ini do I need to change? and by the way, is it possible to change the apahce root directory from /srv/http to something in my home directory? thanks

Offline

#5 2011-07-23 19:11:45

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Running Mysql With Apahce And PHP


ᶘ ᵒᴥᵒᶅ

Offline

#6 2011-07-23 19:31:38

pcuser
Member
Registered: 2011-07-23
Posts: 6

Re: Running Mysql With Apahce And PHP

I actually have read through the documentation and i did figure out how to enable mysql but am having some issues with setting the document root.  I have changed the DocumentRoot and the Directory line in httpd.conf to a folder in my home directory but when I type local host into a web browser I get the following message:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

localhost
Sat Jul 23 12:35:16 2011
Apache/2.2.15 (Unix) PHP/5.3.2 with Suhosin-Patch mod_ssl/2.2.15 OpenSSL/1.0.0 DAV/2

I didnt recieve this message when the document root was set as /srv/http. I'm missing a step here. thanks.

Offline

#7 2011-07-23 19:35:22

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: Running Mysql With Apahce And PHP

pcuser wrote:

I actually have read through the documentation and i did figure out how to enable mysql but am having some issues with setting the document root.  I have changed the DocumentRoot and the Directory line in httpd.conf to a folder in my home directory but when I type local host into a web browser I get the following message:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

localhost
Sat Jul 23 12:35:16 2011
Apache/2.2.15 (Unix) PHP/5.3.2 with Suhosin-Patch mod_ssl/2.2.15 OpenSSL/1.0.0 DAV/2

I didnt recieve this message when the document root was set as /srv/http. I'm missing a step here. thanks.

That's because the user "apache" doesn't have access to your user's home folder.


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#8 2011-07-23 19:50:23

pcuser
Member
Registered: 2011-07-23
Posts: 6

Re: Running Mysql With Apahce And PHP

oh ok. is there a way I can resolve that? if sow how? thanks

Offline

#9 2011-07-23 19:55:54

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: Running Mysql With Apahce And PHP

pcuser wrote:

oh ok. is there a way I can resolve that? if sow how? thanks

Literally 10 seconds of googling:  http://httpd.apache.org/docs/1.3/misc/F … #forbidden


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#10 2011-07-23 23:43:58

pcuser
Member
Registered: 2011-07-23
Posts: 6

Re: Running Mysql With Apahce And PHP

only 10 seconds? nice..however I still would like someone to explain this if possible because I am still lost. on that link you gave me it said  the user/group that apahce is on is not allowed to access those files/folders. How do I change that? the page also said something about chmod, but not I am not sure what to chmod the files to. Excuse the noobieness, but can someone lead me to the solution? google hasn't helped so far. thanks for the help so far guys.

Last edited by pcuser (2011-07-23 23:48:32)

Offline

#11 2011-07-24 02:22:49

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: Running Mysql With Apahce And PHP

pcuser wrote:

only 10 seconds? nice..however I still would like someone to explain this if possible because I am still lost. on that link you gave me it said  the user/group that apahce is on is not allowed to access those files/folders. How do I change that? the page also said something about chmod, but not I am not sure what to chmod the files to. Excuse the noobieness, but can someone lead me to the solution? google hasn't helped so far. thanks for the help so far guys.

Honestly, this would be the better way to do it; as chmod'ing your entire home directory just so you can use it for apache is a security risk.

http://httpd.apache.org/docs/2.0/howto/public_html.html

The reason I mention google is because, by nature, Arch is a distro for learning and trying things out yourself.  You should get comfortable with basic commands, learn how to search / use man pages, etc.  Hand holding is not something that is usually done around here.

smile

Last edited by lifeafter2am (2011-07-24 02:24:10)


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#12 2011-07-24 18:38:18

pcuser
Member
Registered: 2011-07-23
Posts: 6

Re: Running Mysql With Apahce And PHP

Lol so what are these forums for then anyways? I am a noobie to arch not to linux. after a stage 1 gentoo installation i've become more then comfortable using linux and its commands, but I dont like "guessing" what lines a file to edit. I have also done my fair share of googling in my day lol, however this issue had me stumped. perhaps this is the wrong place seek help? I wish my old computer could properly run a more userfriendly distro like ubuntu, that would make things easy lol.

Offline

#13 2011-07-24 21:33:00

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: Running Mysql With Apahce And PHP

pcuser wrote:

Lol so what are these forums for then anyways? I am a noobie to arch not to linux. after a stage 1 gentoo installation i've become more then comfortable using linux and its commands, but I dont like "guessing" what lines a file to edit. I have also done my fair share of googling in my day lol, however this issue had me stumped. perhaps this is the wrong place seek help? I wish my old computer could properly run a more userfriendly distro like ubuntu, that would make things easy lol.

If your from back in the day when we used to do Stage 1 Gentoo installs, then honestly you should have no issue editing config files by hand.  I used Gentoo for over 7 years, and it was where most of my hard learning came from.  Arch should be a breeze comparatively.

These aren't Arch specific files here, they are Apache files, which are the same across systems.  wink

It may seem like it, but I am really not being a dick or anything ... just saying that most of what is being said here is easily accessible from the Apache documentation.

Last edited by lifeafter2am (2011-07-24 21:37:13)


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

Board footer

Powered by FluxBB