LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to get an apache that recognizes php, how to init mysql. (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-get-an-apache-that-recognizes-php-how-to-init-mysql-818689/)

rmknox 07-08-2010 08:02 AM

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

###

2ck 07-08-2010 08:07 AM

Do you have mod_php installed? If you do it should be in /etc/apache2/mods-available/.

rsciw 07-08-2010 08:20 AM

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

rsciw 07-08-2010 08:24 AM

Quote:

Originally Posted by 2ck (Post 4027276)
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


rmknox 07-08-2010 08:38 AM

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

imagine_me2 07-08-2010 09:05 AM

service name is "mysqld" (note the "d").
search for "php" instead in httpd.conf

rsciw 07-08-2010 09:14 AM

ah right, it's mysqld, sorry about that.

did you install mysql-server through
yum install mysql-server
?

rmknox 07-08-2010 10:50 AM

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


rsciw 07-08-2010 11:07 AM

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

rmknox 07-08-2010 12:36 PM

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


All times are GMT -5. The time now is 03:40 PM.