Jump to content

PhpBB


mystified
 Share

Recommended Posts

I'm setting up a backup of this board for cannonfodder to do his testing before making changes to the actual board. I'm using webmin and have gotten apache running and have put my copy of the board which is called phpbb in the /var/www/html directory. The problem is that Apache is only reading my php.index file and I'm only getting that text file when I connect through Apache. Cannonfodder thinks I need to turn php on but I'm not sure how to do this. Please keep in mind that I'm a total newbie with servers but I want to get this up and running and would really appreciate any help. I hope I explained this correctly!

Link to comment
Share on other sites

Hi,

 

Here are a few things save a file called phpinfo.php to /var/www/html with this in it:

 

<?php

phpinfo();

?>

 

hopefully you should get a screen of php related config. If yo uare still getting text and the php module is installed it is often a mime type issue. You need to tell apache to parse php file with php.

 

I just had a look in my mandrake 9 httpd.conf and they do it an interesting way by including files. Search the httpd.conf file for every mention of php, you should something aproximatly like this this:

 

<IfDefine HAVE_PHP4>

LoadModule php4_module extramodules/libphp4.so

</IfDefine>

 

then farther down:

 

<IfDefine HAVE_PHP4>

AddModule mod_php4.c

</IfDefine>

 

 

now finally the mime type has to be dealt with. for mandrake 9, as I said they did it interesting, sure made the httpd.conf file less cluttered though, the included this file: /etc/httpd/conf/addon-modules/php.conf which has the stuff to set the mime types which was:

 

<IfModule mod_php4.c>

 

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

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

 

</IfModule>

 

the AddType bit is very important, without it apache will treat the php files as text files and send them straight to the browser

Link to comment
Share on other sites

Well here's a copy of part my httpd.conf file and it doesn't include any of the lines you posted.

 

### Main Configuration Section

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

###

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 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]

#AddModule mod_mmap_static.c

#AddModule mod_mime_magic.c

#AddModule mod_speling.c

#AddModule mod_auth_dbm.c

#AddModule mod_auth_db.c

#AddModule mod_cern_meta.c

#AddModule mod_example.c

#AddModule mod_unique_id.c

 

Any suggestions?

 

:?

Link to comment
Share on other sites

What you can do is make a copy, rename that httpd.bak then you are free to play with the other. Those lines are needed, you should be able to safly paste them in

 

put the

<IfDefine HAVE_PHP4>

LoadModule php4_module extramodules/libphp4.so

</IfDefine>

 

at the bottom of the load modules part,

 

then put:

 

<IfDefine HAVE_PHP4>

AddModule mod_php4.c

</IfDefine>

 

at the bottom of the AssModule part.

 

Finally add:

 

<IfModule mod_php4.c>

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

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

</IfModule>

 

pretty much anywhere (that is not inside any of the tags <anything></anything>), but I would throw it at the bottom and should be fine.

 

Restart apache. php should now be working. provided it is installed of course. If apache doesnt start or you get 500 errors, you can restore the old httpd.conf and restart again and things should be fine (and try something else)

Link to comment
Share on other sites

when you restart apache does anything apear in the error_log not totally sure where it will be on your system, but I have seen it in /usr/share/apache/logs though it might be stored somewhere else, should be called error_log any errors should be reported there.

 

if those entries were not in there before that definatly explains why it was not working, but the question now is why is it still not working. Perhaps unistalling and reinstalling the rpm?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...