Web Hosting Talk







View Full Version : installing php problem


DigiCrime
11-23-2002, 12:07 AM
Trying to install php but after installation, i tried to bring up php info and all i can see is a blank page and when i view the source i see the code itself, its not executing, so i look at my httpd file and everything thats supposed to be there, IS there. What else do I need to look for??

wakkow
11-23-2002, 03:27 AM
Post the relevant part of your httpd.conf (ie. LoadModule and AddType) so we can rule that out first..

Lippy
11-23-2002, 03:43 AM
As I have done this several times check the following. Make sure you have the appropriate LoadModule and AddType, as well as check the directories that they are pointing towards. Make sure those are exact.

DigiCrime
11-23-2002, 12:34 PM
LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
# For example, the PHP 3.x module (not part of the Apache distribution - see
# http://www.php.net) will typically use:
#
#AddType application/x-httpd-php3 .php3
#AddType application/x-httpd-php3-source .phps
#
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php .php4 .php3
AddType application/x-httpd-php-source .phps

path to conf
/usr/local/psa/apache/conf
path to phplib
/usr/local/psa/apache/libexec

Lippy
11-23-2002, 04:46 PM
Just curious is this a linux or windows installation of php? Once I know this I provide detailed directions as to how to install.

DigiCrime
11-23-2002, 05:21 PM
linux. I looked over a the plesk forums and got the correct installation there, but like an idiot i installed it under /usr/src instead of /usr/local/src/ it didnt work either way but i followed the directions just as it said, and the install went just fine, and the plesk cp loads up fine, its php based so why cant i just load php from anywhere else? :confused:

i appreciate your help as well!

DigiCrime
11-24-2002, 12:04 AM
anyone else willing to chime in be my guest im still having problems

Lippy
11-24-2002, 12:52 AM
My apologizes for not responding sooner, I have never installed php on a linux system but I have a book that explains it, though I don't have it on me at the moment, I will post what it says to do tomorrow.

wakkow
11-24-2002, 02:09 AM
What were your steps to compiling and installing it? For example, what was your configure options, and did you run 'make install' (just checking the obvious first.. :))

jtrovato
11-24-2002, 03:35 AM
Also the extension must be .php it will not work with htm or html extensions... by default.

DigiCrime
11-24-2002, 03:06 PM
got it here

http://forum.plesk.com/showthread.php?s=&threadid=1166

it asks to install it under usr/local/src but the very first time i did it, i installed it under /usr/src/ only thing i can think of, shouldnt matter would it? Either way, i tried different versions of php 4.2.2 and 4.1.0 and nothing. It installs just fine, its just not working,


. Backup httpd.conf and libphp4.so in case anything goes wrong.

code:--------------------------------------------------------------------------------cd /usr/local/psa/apache
cp conf/httpd.conf conf/httpd.conf.mybackup
cp libexec/libphp4.so libexec/libphp4.so.mybackup--------------------------------------------------------------------------------

2. Get current PHP info. Create a PHP file (phpinfo.php, for example) in the httpdocs folder of one of your domains. This file should contain:
code:--------------------------------------------------------------------------------<? phpinfo(); ?>--------------------------------------------------------------------------------
When you view this file through your browser (ie., http://www.yourdomain.com/phpinfo.php ), it'll show you lots of information about the PHP installation on your server. Save the output to a local file so you can compare it to similar output after the upgrade.

3. Download and compile IMAP. This is used by Webmail, so it's required by PHP...
code:--------------------------------------------------------------------------------cd /usr/local/src
wget ftp://ftp.cac.washington.edu/imap/imap.tar.Z
uncompress imap.tar.Z
tar xvf imap.tar
cd imap-2001a
make slx--------------------------------------------------------------------------------


Also, copy the IMAP client header and lib files to appropriate places, as described at http://www.php.net/manual/en/ref.imap.php:
code:--------------------------------------------------------------------------------cp /usr/local/src/imap-2001a/c-client/c-client.a /usr/lib/libc-client.a
cp /usr/local/src/imap-2001a/src/c-client/mail.h /usr/include
cp /usr/local/src/imap-2001a/src/c-client/rfc822.h /usr/include
cp /usr/local/src/imap-2001a/c-client/linkage.h /usr/include
export LDFLAGS="-L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam"--------------------------------------------------------------------------------

4. Install libiodbc, another component required by PHP.
code:--------------------------------------------------------------------------------rpm -U http://www.iodbc.org/dist/libiodbc-...386-glibc21.rpm
rpm -U http://www.iodbc.org/dist/libiodbc-...386-glibc21.rpm--------------------------------------------------------------------------------

5. Download and compile PHP.
code:--------------------------------------------------------------------------------cd /usr/local/src
wget http://download.php.net/distributions/php-4.1.0.tar.gz
tar xvfz php-4.1.0.tar.gz
cd php-4.1.0
./configure --with-apxs=/usr/local/psa/apache/bin/apxs \
--prefix=/usr/local/psa/apache --with-system-regex \
--with-config-file-path=/usr/local/psa/apache/conf \
--disable-debug --disable-pear --enable-sockets \
--enable-track-vars --without-gd \
--with-mysql=/usr/local/psa/mysql --with-iodbc=/usr/lib \
--with-imap=/usr/local/src/imap-2001a
make--------------------------------------------------------------------------------
The configuration options here are based on what was displayed in the phpinfo before the upgrade. Feel free to add other options as you feel necessary.

6. Replace the PHP module used by Apache.
code:--------------------------------------------------------------------------------/usr/local/psa/apache/bin/apachectl stop
cp -f /usr/local/src/php-4.1.0/.libs/libphp4.so /usr/local/psa/apache/libexec/
/usr/local/psa/apache/bin/apachectl start--------------------------------------------------------------------------------

7. View phpinfo again by visiting http://www.yourdomain.com/phpinfo.php ... It should now display the new version and other info for PHP.