FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » can't run install.php, Internal Server Error
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon9.gif  can't run install.php, Internal Server Error [message #6182] Sat, 05 October 2002 02:40 Go to next message
jason   United States
Messages: 6
Registered: October 2002
Karma: 0
Junior Member
I'm new to PHP in general but have done some linux admin in the past so I'm not a complete newbie. My server does run CGI scripts from the same directory (cgi-bin) as I put the install.php file in and both my test cgi script which runs and my install.php which does not run have exactly the same permissions and owner:groups. When I try and browse to install.php, my web browser tells me Internal Server Error. Upon inspecing my apache error_log, I see the message "Premature end of script headers: /var/www/cgi-bin/install.php". I'm fairly sure that install.php is intact because I get no errors when I run php from the command line on it (though maybe that's insignificant, like I said, I'm new to PHP).

I'm very excited about getting FUDforum going on my machine and appreciate any feedback I can get. I've been beating my head against the desk trying to see an apache misconfiguration but am failing to find one. What can I try?
Re: can't run install.php, Internal Server Error [message #6186 is a reply to message #6182] Sat, 05 October 2002 13:10 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
This is a PHP error. Which PHP and what webserver are you using?

FUDforum Core Developer
Re: can't run install.php, Internal Server Error [message #6201 is a reply to message #6186] Sat, 05 October 2002 16:46 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Apache spits out this error message because there's something wrong with either the httpd.conf or with php module itself. If it's the httpd.conf then u have to check whether the module is loaded on start up. this would typically look like (Apache 1.3.x):
Quote:

[..]
LoadModule php4_module modules/libphp4.so
[...]
AddModule mod_php4.c
[...]
DirectoryIndex index.html index.htm index.shtml index.php index.php4
[...]
AddType application/x-httpd-php .php4 .php3 .phtml .php


At any case u have to specify the correct location of the module else execution will fail. If it's a php issue then it could be because ur php was compiled with the headers of an elder server version. with each server upgrade u have to re-compile all of ur modules as well.
HTH
bye Ken

[Updated on: Sat, 05 October 2002 16:47]

Report message to a moderator

Re: can't run install.php, Internal Server Error [message #6207 is a reply to message #6201] Sat, 05 October 2002 18:24 Go to previous messageGo to next message
jason   United States
Messages: 6
Registered: October 2002
Karma: 0
Junior Member
I've got the new Mandrake 9.0 with apache version 1.3.26. PHP version 4.2.3. This was a clean install and /supposedly/ Mandrake installed both PHP and Apache correctly. I do have the necessary lines in httpd.conf (Specifying mine types and module locations). It loads php4_module from extramodules/libphp4.so which I checked and verified was there. Then in the AddModule section it says AddModule mod_php4.c which I haven't been able to locate, where should I look for it? I have a php binary in my /usr/bin but I haven't been able to locate a php.ini which I've heard some people mention. Maybe I'm just not looking in the right place?
Re: can't run install.php, Internal Server Error [message #6251 is a reply to message #6207] Sun, 06 October 2002 22:44 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
To get PHP working within Apache you really need just a few lines:

LoadModule php4_module libexec/libphp4.so

this loads the PHP module.

AddType application/x-httpd-php .php

This tells the server to have apache pass all files ending with a .php extension to the PHP module for parsing.



FUDforum Core Developer
Re: can't run install.php, Internal Server Error [message #6258 is a reply to message #6207] Sun, 06 October 2002 22:56 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
jason wrote on Sat, 05 October 2002 20:24

Then in the AddModule section it says AddModule mod_php4.c which I haven't been able to locate, where should I look for it?

It's not tragical if it's not there. Most important is the module itself, with the .so ending. Apache 2 no longer has an addmodule section anyway.
Quote:

I have a php binary in my /usr/bin but I haven't been able to locate a php.ini which I've heard some people mention. Maybe I'm just not looking in the right place?

the php.ini is in /etc
my.cnf (mysql) also can be found there
bye Ken

[Updated on: Sun, 06 October 2002 22:57]

Report message to a moderator

Re: can't run install.php, Internal Server Error [message #6259 is a reply to message #6258] Sun, 06 October 2002 23:00 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Apache 2 requires a slightly different data inside httpd.conf to enable php support.

LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php

By default, php installs it's php.ini file inside /usr/local/lib/php.ini. If it is not there, simply have php show you it's phpinfo() output, that will tell you the path where PHP is looking for the .ini file.

On the console this can be done by doing the following:

php -i | grep ini


FUDforum Core Developer
Re: can't run install.php, Internal Server Error [message #6275 is a reply to message #6182] Mon, 07 October 2002 13:49 Go to previous messageGo to next message
jason   United States
Messages: 6
Registered: October 2002
Karma: 0
Junior Member
Wow thanks everyone for the great feedback. I was able to locate my php.ini file in /etc and it appears to be configured correctly... in my commonhttpd.conf (which is included by httpd.conf) are the lines:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

and in my httpd.conf is

LoadModule php4_module extramodules/libphp4.so
AddModule mod_php4.c

yet still I get the "Internal Server Error" and in the log it says:

[Mon Oct 7 09:46:28 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Mon Oct 7 09:46:40 2002] [error] (8)Exec format error: exec of /var/www/cgi-bin/install.php failed
[Mon Oct 7 09:46:40 2002] [error] [client 127.0.0.1] Premature end of script headers: /var/www/cgi-bin/install.php

Any more ideas? Thanks everyone.
Re: can't run install.php, Internal Server Error [message #6278 is a reply to message #6275] Mon, 07 October 2002 14:13 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You should NOT have both
'LoadModule php4_module extramodules/libphp4.so'
and
'AddModule mod_php4.c'.
Remove the last line.

After you do so and start Apache, 1st do a quick test to see if PHP works, by making a file called test.php. Inside that file put
<?php phpinfo(); ?>

and then try to view the file with your browser. Once this test works try installing the forum. If you still get the error, then edited the 'magic_quote_runtime' option inside php.ini and set it to 'Off'.


FUDforum Core Developer
Re: can't run install.php, Internal Server Error [message #6286 is a reply to message #6182] Mon, 07 October 2002 15:38 Go to previous messageGo to next message
jason   United States
Messages: 6
Registered: October 2002
Karma: 0
Junior Member
Alright I removed the AddModule mod_php4.c line, restarted the server and pointed to a test.php with the test line of php and got the same error, internal server error. Log said the same "Premature end of script headers" stuff. Checked php.ini for the setting you mentioned and it's already off. One thing I noticed, the php.conf file that httpd.conf is including contains two lines:

AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps

these are -also- in my commonhttpd.conf file... is it hurting having them both or does it matter?

BTW, I really appreciate the assistance here. I know that this is a PHP/apache config type problem and is unrelated to FUDforum and so thank you for paying attention and trying to help.

Here is my entire httpd.conf file, for what it's worth Smile

### Main Configuration Section
### You really shouldn't change these settings unless you're a guru
###

Options ExecCGI
ServerType standalone
ServerRoot /etc/httpd
#ServerName localhost
#LockFile /etc/httpd/httpd.lock
PidFile /var/run/httpd.pid
ScoreBoardFile /etc/httpd/httpd.scoreboard
ErrorLog logs/error_log
LogLevel warn
ResourceConfig /dev/null
AccessConfig /dev/null
DocumentRoot /var/www/html


### Dynamic Shared Object (DSO) Support
###
###
#LoadModule mmap_static_module modules/mod_mmap_static.so
LoadModule env_module modules/mod_env.so
LoadModule config_log_module modules/mod_log_config.so
LoadModule agent_log_module modules/mod_log_agent.so
LoadModule referer_log_module modules/mod_log_referer.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module modules/mod_status.so
LoadModule info_module modules/mod_info.so
LoadModule includes_module modules/mod_include.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule asis_module modules/mod_asis.so
LoadModule imap_module modules/mod_imap.so
LoadModule action_module modules/mod_actions.so
#LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule proxy_module modules/libproxy.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule anon_auth_module modules/mod_auth_anon.so
#LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule db_auth_module modules/mod_auth_db.so
LoadModule digest_module modules/mod_digest.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule example_module modules/mod_example.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule php4_module extramodules/libphp4.so
<IfDefine HAVE_SSL>
LoadModule ssl_module extramodules/libssl.so
</IfDefine>
<IfDefine HAVE_SXNET>
LoadModule sxnet_module extramodules/mod_sxnet.so
</IfDefine>
LoadModule vhost_alias_module modules/mod_vhost_alias.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
#AddModule mod_mmap_static.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
#AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_proxy.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
#AddModule mod_auth_dbm.c
#AddModule mod_auth_db.c
AddModule mod_digest.c
#AddModule mod_cern_meta.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
#AddModule mod_example.c
#AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c

<IfDefine HAVE_SSL>
AddModule mod_ssl.c
</IfDefine>
<IfDefine HAVE_SXNET>
AddModule mod_sxnet.c
</IfDefine>
AddModule mod_vhost_alias.c

###
### Global Configuration
###
# We now support multiple apache configurations on the same server. In
# common.conf, we put all directives that are common to all implementations
# (httpd, httpd-perl, etc.)
Include conf/commonhttpd.conf


###
### IP Address/Port and Proxied configuration section
###
# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
# the fast web server serves static content while Apache handles the
# cgi or php files

#BindAddress *
<IfDefine APACHEPROXIED>
Port 8080
Listen 8080
</IfDefine>
<IfDefine !APACHEPROXIED>
Port 80
Listen 80
</IfDefine>

# Likewise, we can set apache as the server by default and send perl
# requests via ProxyPass to apache-mod_perl. It increases performance
# since the perl interpreter is only used for perl and the standard apache
# does all the html and image files, with a smaller footprint.
#
# If you install apache and apache-mod_perl, this is the default config.
# If you don't want two web servers to use perl, uninstall apache, and
# apache-mod_perl will not be proxied.

<IfDefine PERLPROXIED>
RewriteEngine on
RewriteRule ^proxy:.* - [F]
RewriteRule ^(.*\/perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
RewriteRule ^(.*\/cgi-perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
</IfDefine>

###
### Log configuration Section
###

#Single logfile with access, agent and referer information
#This is the default, if vlogs are not defined for the main server
CustomLog logs/access_log combined env=!VLOG
#If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry
CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG


###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/Vhosts.conf
#Include conf/vhosts/DynamicVhosts.conf
#Include conf/vhosts/VirtualHomePages.conf


###
### Performance settings Section
###
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Server-pool size regulation. Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
#
# It does this by periodically checking how many servers are waiting
# for a request. If there are fewer than MinSpareServers, it creates
# a new spare. If there are more than MaxSpareServers, some of the
# spares die off. The default values are probably OK for most sites.
#
MinSpareServers 4
MaxSpareServers 10

#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 4

#
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
MaxClients 150

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies. The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources. On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
#
# NOTE: This value does not include keepalive requests after the initial
# request per connection. For example, if a child process handles
# an initial request and 10 subsequent "keptalive" requests, it
# would only count as 1 request towards this limit.
#
MaxRequestsPerChild 500

Include conf/addon-modules/php.conf
Include conf/ssl/mod_ssl.conf
Include conf/ssl/ssl.default-vhost.conf
ScriptAliasMatch /cgi-bin/ /var/www/cgi-bin/
ExtendedStatus on

[Updated on: Mon, 07 October 2002 16:00]

Report message to a moderator

Re: can't run install.php, Internal Server Error [message #6287 is a reply to message #6286] Mon, 07 October 2002 16:24 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Did the test script I've writtten for you in my previous email work?

FUDforum Core Developer
Re: can't run install.php, Internal Server Error [message #6289 is a reply to message #6182] Mon, 07 October 2002 16:27 Go to previous messageGo to next message
jason   United States
Messages: 6
Registered: October 2002
Karma: 0
Junior Member
Nope Sad

[Mon Oct 7 12:04:43 2002] [error] (8)Exec format error: exec of /var/www/cgi-bin/test.php failed
[Mon Oct 7 12:04:43 2002] [error] [client 127.0.0.1] Premature end of script headers: /var/www/cgi-bin/test.php


the contents of test.php:

<?php phpinfo(); ?>

file permissions (just in case) for test.php:

-rwxrwxrwx 1 apache apache test.php*

[Updated on: Mon, 07 October 2002 16:40]

Report message to a moderator

Re: can't run install.php, Internal Server Error [message #6290 is a reply to message #6289] Mon, 07 October 2002 17:00 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Looks like something in your apache not configure correctly. To be honest I am not sure why, never had to deal with Mandrake's distro of Apache, I always compile my own...
As some Mandrake users, surely they can assist you with this problem more then I can.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Default theme doesn't apply
Next Topic: How do i create a DataBase?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 14:43:52 GMT 2024

Total time taken to generate the page: 0.21574 seconds