LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-08-2010, 08:02 AM   #1
rmknox
Member
 
Registered: May 2010
Posts: 354

Rep: Reputation: 34
How to get an apache that recognizes php, how to init mysql.


I want to have apache + php + mysql.

My apache does not recognize php and mysql is only partially installed.

Php works but not thru apache. The apache conf file has no reference to it.
I'm on fedora 2.6.31.5-127.fc12.i686.

In case it matters, I insalled some security updates that created a defective later version -
2.6.32.5 which loops and displays garbage. At startup I interrupt grub and tell it to run the
old one. I would remove the defective one but don't know how. I'm an experienced systems
programmer with almost no unix time. (pdp8-os8, pdp11-rsx, tandem-tal, vax-vms,os360, etc)

I ran yum install mysql-develop -- with no understanding of what it did.

If in super user mode I type 'mysql - v' it responds
ERROR 2002 (HY000) Can't connect to local MySql server through
socket /var/lib/mysql/mysql.sock(2).

If I could load a pre asembled apache that would be ideal.

My primary question - what is the easiest (i.e. least needing of unix expertise) way
to get the apache I want. If necessary I will wade thru the documentation
apparently needed to assemble it, but am in hope that there is a less time consuming way.
( Friend with Windows merely loaded 'wamp' and was immeditely up and running.)
Maybe someone can suggest the way to get there with minimum unix expertise.

Secondary issue - how to get mysql functioning - I suspect that a little research would
solve this one, but if a friendly expert has some advice I would be happy to take it.

Thanks in advance.

Dick

###
 
Old 07-08-2010, 08:07 AM   #2
2ck
Member
 
Registered: Mar 2010
Location: /home/twock
Distribution: Debian
Posts: 73
Blog Entries: 9

Rep: Reputation: 21
Do you have mod_php installed? If you do it should be in /etc/apache2/mods-available/.
 
Old 07-08-2010, 08:20 AM   #3
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
how did you install apache/mysql/php?

on fedora you (should) just need:
yum install httpd mysql mysql-server php

php installation should take care of the apache config so that apache recognizes .php files.

are you trying to get the mysql version with mysql -v?
if so, it's
mysql -V or mysql --version

mysql should've been started upon installation, but you can double check by running
sudo /etc/init.d/mysql status
or
sudo service mysql status
 
Old 07-08-2010, 08:24 AM   #4
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
Quote:
Originally Posted by 2ck View Post
Do you have mod_php installed? If you do it should be in /etc/apache2/mods-available/.
this setup you describe is the debian way.

in fedora (red hat, centos, etc.) it should be in
/usr/lib/httpd/modules/
and is called libphp5.so instead of mod_php.so (at least on my centos box here right now)
substitute lib/ for lib64/ on an x86_64 box.

php installation should add the php.conf file to
/etc/httpd/conf.d
containing

Code:
<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>

<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

AddHandler php5-script .php
AddType text/html .php

DirectoryIndex index.php
 
Old 07-08-2010, 08:38 AM   #5
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
when I look in /etc/httpd/modules i do not find mod_php

when I type sudo service mysql status it says
mysql: unrecognized service

when i type sudo /etc/init.d/mysql status it says
sudo /etc/init.d/mysql: command not found
 
Old 07-08-2010, 09:05 AM   #6
imagine_me2
Member
 
Registered: Nov 2009
Location: Kolkata, India
Distribution: Fedora 11
Posts: 136

Rep: Reputation: 22
service name is "mysqld" (note the "d").
search for "php" instead in httpd.conf
 
Old 07-08-2010, 09:14 AM   #7
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
ah right, it's mysqld, sorry about that.

did you install mysql-server through
yum install mysql-server
?
 
Old 07-08-2010, 10:50 AM   #8
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
Fantastic - I'm almost there.

I typed
yum install httpd mysql mysql-server php -- and

when I run a test php page on local host - it works - apache sees php

BUT

it does not show mysql as one of the services

when I run the same test page on godaddy where I have a page

it comes back with a section that describes the mysql service

GO DADDY shows the following - there is no such info on localhost

Code:
mysql
MySQL Support	enabled
Active Persistent Links 	0
Active Links 	0
Client API version 	5.0.18
MYSQL_MODULE_TYPE 	external
MYSQL_SOCKET 	/usr/local/mysql-5.0/data/mysql.sock
MYSQL_INCLUDE 	-I/usr/local/mysql-5.0/include/mysql
MYSQL_LIBS 	-L/usr/local/mysql-5.0/lib/mysql -lmysqlclient

Directive	Local Value	Master Value
mysql.allow_persistent	On	On
mysql.connect_timeout	60	60
mysql.default_host	no value	no value
mysql.default_password	no value	no value
mysql.default_port	no value	no value
mysql.default_socket	no value	no value
mysql.default_user	no value	no value
mysql.max_links	Unlimited	Unlimited
mysql.max_persistent	Unlimited	Unlimited
mysql.trace_mode	Off	Off
 
Old 07-08-2010, 11:07 AM   #9
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
the box @ godaddy also running fedora?

might still have to run
yum install php-mysql

thought it'd be a dependency, but maybe it wasn't.
try above and see what appears
 
Old 07-08-2010, 12:36 PM   #10
rmknox
Member
 
Registered: May 2010
Posts: 354

Original Poster
Rep: Reputation: 34
Fantastic - i typed yum install php-mysql and
it installed php-pdo and php-mysql and now
I also have mysql on my display

regarding godaddy, they are on linux - following from godaddy
Quote:

PHP Version 4.4.9

System Linux p3slh016.shr.phx3.secureserver.net 2.4.21-63.ELsmp #1 SMP Tue Nov 3 18:23:59 EST 2009 i686
Build Date Jun 16 2010 14:35:02
Configure Command './configure' '--with-cgi' '--enable-fastcgi' '--with-config-file-path=/web/conf' '--with-gd' '--with-xml' '--with-gettext' '--with-zlib-dir=/usr/src/zlib' '--disable-posix' '--with-jpeg-dir=../jpeg-6b' '--enable-gd-native-ttf' '--enable-ftp' '--with-freetype-dir=/usr' '--with-freetype' '--with-sybase=/usr/src/freetds' '--with-curl=/usr/bin/curl' '--with-dom' '--enable-calendar' '--enable-soap' '--enable-bcmath' '--with-zip' '--with-openssl' '--with-mcrypt' '--with-mysql=/usr/local/mysql-5.0'
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /home/content/d/i/c/dickknox/html/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety disabled
Registered PHP Streams php, http, ftp, https, ftps, compress.zlib

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by Zend Technologies
My problem is solved - somewhere there is a way to tell the system I'll post and find the way
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php/shell script to install mysql,apache and php automatically stranger_6_7 Linux - General 2 08-11-2009 02:07 AM
Apache/MySQL/PHP MontyPY Linux - Software 10 03-04-2005 03:14 PM
help apache+php+mysql linuxtm2005 Linux - General 3 01-01-2004 12:39 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 06:23 AM


All times are GMT -5. The time now is 08:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration