[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] PHP, Apache, MySQL issue



Hello Daren,

Tuesday, August 01, 2000, 8:21:24 AM, you wrote:

DC> Hello all...I've got quite a complicated situation, so I'll try to explain
DC> it as well as possible.

DC> I am setting up a client on a RaQ3 with a shopping site, complete with a
DC> cart, online ordering, etc...this is all being done using PHP &
DC> MySQL...however, I just recently discovered a major problem. I'm not real
DC> certain of the terminology, but I know php can be installed two different
DC> ways...one is "under" apache, so that it works with it, and the other does
DC> not; it installs like perl would, so that a separate process has to be
DC> launched for each php script interpreted. Whenever I have installed PHP it
DC> has installed the first way (must be the default)...I have never known or
DC> cared to know the difference but I have been told that if not installed
DC> the first way, persistent database connections do not work.

DC> Persisten DB connections are essential for this website to operate! When I
DC> try to install PHP "under" apache, I get an error, and it auto. installs
DC> the other way. (The error is below). Everythign works, but a new
DC> connection is launched to the DB each time a script is called, which makes
DC> the site unoperable.

DC> The only other issue to consider is why is apache installed the way it
DC> is? It's the only server I operate here that is, and I believe the reason
DC> is that ChiliSOft is running on that server.

DC> The question: Is there any way I can reconfigure apache so that I can
DC> install PHP so that it will accept Persistent DB connections and not
DC> tamper with the ChiliSoft program?

DC> Thanks a lot!

DC> ERROR MESSAGE:
DC> apxs:Warning: /usr/bin/httpd not found or not executable
DC> apxs:Warning: Continuing anyway...
DC> apxs:Warning: No shared object support for Apache
DC> apxs:Warning: available under your platform. Make sure
DC> apxs:Warning: the Apache module mod_so is compiled into
DC> apxs:Warning: your server binary `/usr/bin/httpd'.
DC> apsx:Warning: Continuing anyway...
I have compiled php4 from sorce on my Raq3 with no problem you have to
compile it as a module with apxs for it to work
Hear is what I did and it runs fine. The other way of installing php
is as a cgi stand alone program and it is well documented in the
install files that come with the source. That is not what you want.

 I just ran configure like this
Don't just copy and past this type or copy on module at a time you
don't want a bunch of spaces in it
./configure --prefix=/usr --with-apxs=/usr/sbin/apxs
 --with-config-file-path=/etc/httpd/conf
  --with-exec-dir=/usr/sbin/httpd --with-system-regex
  --disable-debug --with-zlib --enable-safe-mode
   --with-gdbm --with-db2 --enable-magic-quotes
    --enable-debugger --enable-track-vars --enable-sysvsem
     --with-ftp --with-imap --with-xml --with-gd=/usr/include/gd.h
      --with-ttf --with-readline --with-mysql --with-pgsql

      It will give you a warning about apex but ignore it.
      then do a make
      then a make install
      then you have to go to the httpd conf file and change the part
      at the top that says this   put # in front of php3 module if you
      have that and add /usr in front of the path to libphp4.so and
      then do the same thing in the section below this the one with AddModule mod_php4.c


# Documentation for modules is in "/home/httpd/manual/mod" in HTML format.

# Extra Modules
#LoadModule php_module         modules/mod_php.so
#LoadModule php3_module           /usr/lib/apache/libphp3.so
#LoadModule perl_module        /usr/lib/apache/libperl.so
LoadModule php4_module       /usr/lib/apache/libphp4.so    

#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
#ClearModuleList

# Extra Modules
#AddModule mod_php.c
#AddModule mod_php3.c
#AddModule mod_perl.c
AddModule mod_php4.c      

Now open srm.conf and go to the line that looks like this
# For example, the PHP3 module (not part of the Apache distribution)
# will typically use:
AddType application/x-httpd-php .php3 .php
#AddType application/x-httpd-php3-source .phps
# The following is for PHP/FI (PHP2):
#AddType application/x-httpd-php3 .php

change to the way you what to run php.
Restart apache and you should be up and running
To add the optimizer gust follow the directions that come with it.
If you figure how to upgrade Apache let me know. My next server will
be a regular Linux box that a person can actually work on. Cobalt sucks