Click to See Complete Forum and Search --> : .PHP is not recognized
jakawan
09-14-2004, 06:13 PM
I have installed PHP5 with Apache 2.0.50 sucessfully.
However, when I run any php file from a web browser, i get the " *.php is not recognized" problem. IE will ask me to download the file or Netscape will execute the file locally.
in my /etc/httpd/conf.d/php.conf
I have added:
LoadModule php5_module modules/libphp5.so
#AddModule sapi_apache2.c
#AddType mod_php4.c
#AddModule mod_php5.c
#LoadModule sapi_apache2.c modules/libphp5.so
AddType application/x-httpd-php .php .php4 .php3 .phtml
DirectoryIndex index.php index.php3
Any idea?
thanks,
Jak
kkobashi
09-15-2004, 12:28 AM
I've done the following to get mine working:
PHP 5
Apache 2.0.50d
Windows 2000
Look for your httpd.conf file in the Apache directory. Add these two lines at the end of the file:
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php
Hope this helps.
jakawan
09-15-2004, 03:17 PM
Thanks for you help, Kerry .
I have those lines in my config already, but still not working..
Jak
kkobashi
09-15-2004, 03:45 PM
How about the INI file... did you place it in the Windows directory
jakawan
09-16-2004, 01:35 PM
I did that too. Still not working.. not sure what the problem is.
kkobashi
09-16-2004, 01:40 PM
did you try using the dll...
You loaded this:
LoadModule php5_module modules/libphp5.so
Look at mine...
I loaded this:
LoadModule php5_module "c:/php/php5apache2.dll"
Create a file called phpinfo.php:
<?php phpinfo(); ?>
Run this. Don't try to run another php file until you get this working. Keep it simple.
jakawan
09-16-2004, 02:06 PM
THis is what I have in my httpd.conf file:
LoadModule php5_module "/etc/httpd/modules/libphp5.so"
AddType application/x-httpd-php .php
DirectoryIndex index.php index.php3
PHPIniDir /etc
When I run command:
[root]# php -r 'phpinfo();'
I get:
phpinfo()
PHP Version => 5.0.1
System => Linux xxx.com 2.4.25-040218 #1 SMP Wed Feb 18 17:59:29 CET 2004 i686
Build Date => Aug 24 2004 08:49:57
Configure Command => './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-libxml-dir=/root/libxml2-2.6.12'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php.ini
PHP API => 20031224
PHP Extension => 20040412
Zend Extension => 220040412
Debug Build => no
Thread Safety => disabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp
Registered Stream Socket Transports => tcp, udp, unix, udg
Zend Engine v2.0.1, Copyright (c)
Configuration
PHP Core
Directive => Local Value => Master Value
allow_call_time_pass_reference => On => On
allow_url_fopen => On => On
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no
...
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 2039 => 2039
expose_php => On => On
extension_dir => /usr/lib/php5 => /usr/lib/php5
file_uploads => On => On
.....
html_errors => Off => On
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => Off
include_path => .:/usr/local/lib/php => .:/usr/local/lib/php
log_errors => Off => Off
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => On => On
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
mail.force_extra_parameters => no value => no value
max_execution_time => 0 => 30
max_input_time => 60 => 60
open_basedir => no value => no value
output_buffering => 0 => no value
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
register_argc_argv => On => On
register_globals => Off => Off
register_long_arrays => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 100 => 100
short_open_tag => On => On
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
variables_order => EGPCS => EGPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => Off => Off
zend.ze1_compatibility_mode => Off => Off
ctype
ctype functions => enabled
dom
DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.6.12
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled
iconv
iconv support => enabled
iconv implementation => glibc
iconv library version => 2.3.2
Directive => Local Value => Master Value
iconv.input_encoding => ISO-8859-1 => ISO-8859-1
iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
iconv.output_encoding => ISO-8859-1 => ISO-8859-1
libxml
libXML support => active
libXML Version => 2.6.12
libXML streams => enabled
pcre
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 4.5 01-December-2003
posix
Revision => $Revision: 1.60 $
session
Session Support => enabled
Registered save handlers => files user sqlite
Registered serializer handlers => php php_binary
Directive => Local Value => Master Value
session.auto_start => Off => Off
session.bug_compat_42 => On => On
session.bug_compat_warn => On => On
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => no value => no value
session.entropy_length => 0 => 0
session.gc_divisor => 100 => 100
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.hash_bits_per_character => 4 => 4
session.hash_function => 0 => 0
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => /tmp => /tmp
session.serialize_handler => php => php
session.use_cookies => On => On
session.use_only_cookies => Off => Off
session.use_only_cookies => Off => Off
session.use_trans_sid => 0 => 0
SimpleXML
Simplexml support => enabled
Revision => $Revision: 1.139.2.3 $
Schema support => enabled
SPL
SPL support => enabled
Interfaces => RecursiveIterator, SeekableIterator
Classes => ArrayObject, ArrayIterator, CachingIterator, CachingRecursiveIterator, DirectoryIterator, FilterIterator, LimitIterator, ParentIterator, RecursiveD
irectoryIterator, RecursiveIteratorIterator, SimpleXMLIterator
SQLite
SQLite support => enabled
PECL Module version => 2.0-dev $Id: sqlite.c,v 1.146.2.2 2004/08/02 22:43:42 iliaa Exp $
SQLite Library => 2.8.14
SQLite Encoding => iso8859
Directive => Local Value => Master Value
sqlite.assoc_case => 0 => 0
standard
Regex Library => Bundled library enabled
Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i
.....
.
PHP Variables
Variable => Value
_SERVER["MANPATH"] => /usr/lib/courier-imap/man:
_SERVER["HOSTNAME"] => u15157708.onlinehome-server.com
_SERVER["TERM"] => xterm
_SERVER["SHELL"] => /bin/bash
_SERVER["CATALINA_HOME"] => /var/tomcat4
_SERVER["HISTSIZE"] => 1000
_SERVER["SSH_CLIENT"] => 63.150.123.162 3984 22
_SERVER["OLDPWD"] => /root
_SERVER["CATALINA_BASE"] => /var/tomcat4
_SERVER["SSH_TTY"] => /dev/pts/1
_SERVER["USER"] => root
_SERVER["LS_COLORS"] => no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32
:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=0
0;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
_SERVER["USERNAME"] => root
_SERVER["MAIL"] => /var/spool/mail/root
_SERVER["PATH"] => /usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:
/usr/java/j2sdk1.4.2/bin:/opt/java/apache-ant-1.6.2/bin
_SERVER["INPUTRC"] => /etc/inputrc
_SERVER["PWD"] => /etc/httpd/conf.d
_SERVER["JAVA_HOME"] => /usr/java/j2sdk1.4.2
_SERVER["LANG"] => en_US.UTF-8
_SERVER["SHLVL"] => 1
_SERVER["HOME"] => /root
_SERVER["BASH_ENV"] => /root/.bashrc
_SERVER["LOGNAME"] => root
_SERVER["CLASSPATH"] => :/usr/share/java/xerces.jar:/usr/share/java/xercesSamples.jar:/opt/java/apache-ant-1.6.2/lib
_SERVER["SSH_CONNECTION"] => 63.150.123.162 3984 217.160.253.144 22
_SERVER["LESSOPEN"] => |/usr/bin/lesspipe.sh %s
_SERVER["CATALINA_TMPDIR"] => /var/tomcat4/temp
_SERVER["G_BROKEN_FILENAMES"] => 1
_SERVER["_"] => /usr/local/bin/php
_SERVER["PHP_SELF"] => -
_SERVER["SCRIPT_NAME"] => -
_SERVER["SCRIPT_FILENAME"] =>
_SERVER["PATH_TRANSLATED"] =>
_SERVER["DOCUMENT_ROOT"] =>
_SERVER["argv"] => Array
(
[0] => -
)
_SERVER["argc"] => 1
_ENV["MANPATH"] => /usr/lib/courier-imap/man:
_ENV["HOSTNAME"] => u15157708.onlinehome-server.com
_ENV["TERM"] => xterm
_ENV["SHELL"] => /bin/bash
_ENV["CATALINA_HOME"] => /var/tomcat4
_ENV["HISTSIZE"] => 1000
_ENV["SSH_CLIENT"] => 63.150.123.162 3984 22
_ENV["OLDPWD"] => /root
_ENV["CATALINA_BASE"] => /var/tomcat4
_ENV["SSH_TTY"] => /dev/pts/1
_ENV["USER"] => root
_ENV["LS_COLORS"] => no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.
com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;3
1:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
_ENV["USERNAME"] => root
_ENV["MAIL"] => /var/spool/mail/root
_ENV["PATH"] => /usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/us
r/java/j2sdk1.4.2/bin:/opt/java/apache-ant-1.6.2/bin
_ENV["INPUTRC"] => /etc/inputrc
_ENV["PWD"] => /etc/httpd/conf.d
_ENV["JAVA_HOME"] => /usr/java/j2sdk1.4.2
_ENV["LANG"] => en_US.UTF-8
_ENV["SHLVL"] => 1
_ENV["HOME"] => /root
_ENV["BASH_ENV"] => /root/.bashrc
_ENV["LOGNAME"] => root
_ENV["CLASSPATH"] => :/usr/share/java/xerces.jar:/usr/share/java/xercesSamples.jar:/opt/java/apache-ant-1.6.2/lib
_ENV["SSH_CONNECTION"] => 63.150.123.162 3984 217.160.253.144 22
_ENV["LESSOPEN"] => |/usr/bin/lesspipe.sh %s
_ENV["CATALINA_TMPDIR"] => /var/tomcat4/temp
_ENV["G_BROKEN_FILENAMES"] => 1
_ENV["_"] => /usr/local/bin/php
so far, PHP is working via command line, but when i run via apache, it won't work. Click on this link below:
http://abouttrianglehosting.com/test/phpinfo.php
ideas?
kkobashi
09-17-2004, 06:43 AM
How can we help you if you don't read the messages carefully and try them?
Didn't I ask twice to try the .DLL instead of the .SO file?
jakawan
09-17-2004, 09:36 AM
I have read you comments about the file name. I think you are refering to Windows for DLL. I'm using RedHat 9. THere is no such thing as DLL, only .so. See below, I searched the entire server for the file php5apache2.*"
[root@u15157708 root]# find / -name php5apache2*
/root/php-5.0.1/sapi/apache2handler/php5apache2.dsp
/root/php-5.0.1/netware/php5apache2filter.mak
/root/php5-STABLE-200408240430/sapi/apache2handler/php5apache2.dsp
/root/php5-STABLE-200408240430/netware/php5apache2filter.mak
/root/php5-200408252030/sapi/apache2handler/php5apache2.dsp
/root/php5-200408252030/netware/php5apache2filter.mak
kkobashi
09-17-2004, 06:29 PM
http://media.wiley.com/product_data/excerpt/31/07645578/0764557831.pdf
Read that PDF file ... maybe that will help
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.