browolf Posted January 26, 2009 Posted January 26, 2009 it used to be the case I could make a no-frills webserver with debian, really easily. do a base install manually install apache php mysql phpmyadmin in that order and it would magically work just done it and now php doesnt work I'm getting unknown file type on php files in IE wtf!? I despair with linux cos they keep moving the goalposts!
danrhodes Posted January 26, 2009 Posted January 26, 2009 You will need to add the apache file type handler. Follow the destructions below: http://rssfeedreader.com/php.html #1 Instructions for adding PHP code to an HTML site; PHP scripts do not automatically work on html pages. If you have an HTML or (.HTM) based site, in order for PHP scripts to run on your .htm or .html pages you have a 2 options; For Apache Servers Edit your .htacess with AddType application/x-httpd-php .htm .html Then Add the php code from the reader directly to your html pages For Apache Servers Edit your .htacess with either .htm server parsed .html server parsed or Addhandler application/x-httpd-php .html .php Then follow the directions below to use the php code from the reader with SSI Includes. ***NOTE: For Windows or IIS servers - You do not have an .htaccess file. Windows IIS servers also cannot run php on html pages. Your only option for windows IIS servers is to use .shtml or .php pages with the php option from the reader. Or add Javascript to your html pages. For .shtml pages check your setup options and make sure the option for SSI inlcudes is checked, then follow the directions below for creating the SSI include and file.
Guest Guest Posted January 26, 2009 Posted January 26, 2009 Or just download Ubuntu Server and click LAMP. then install phpmyadmin and you're done. Takes all of 5 minutes.
browolf Posted January 26, 2009 Author Posted January 26, 2009 (edited) those instructions say "#2 Instructions for adding PHP code to a PHP site; For a PHP based website, you simply add the PHP code produced by the RSS Reader directly to your PHP pages. Do not modify it in any way. Add the PHP code to the web page anywhere that you want to display the headlines. You may add it to as many pages on your site as warranted. Do NOT modify your .htaccess file for PHP pages. " im not trying to add php to html pages. a simple test.php of phpinfo() in /var/www doesnt even work. Edited January 26, 2009 by browolf
powdarrmonkey Posted January 26, 2009 Posted January 26, 2009 Which distribution of Debian - etch (stable) or lenny (testing)?
danrhodes Posted January 26, 2009 Posted January 26, 2009 Oh, sorry I though you were wanting to add php to html docs, my mistake! Not sure why PHP wont work then. D
browolf Posted January 26, 2009 Author Posted January 26, 2009 Which distribution of Debian - etch (stable) or lenny (testing)? its etch.
powdarrmonkey Posted January 26, 2009 Posted January 26, 2009 Ok, I've just woken up. You need to install libapache2-mod-php (or similar, eg libapache-mod-php5/libapache2-mod-php4 - you get the idea). Check which version of apache you have first. If apt screams at you, you've probably used the wrong apache version. Apache2 is the default in both etch and lenny, I think. Then, move the configuration for it from mods-available to mods-enabled: mv /etc/apache2/mods-available/php5* /etc/apache2/mods-enabled Do you use aptitude or apt-get?
browolf Posted January 26, 2009 Author Posted January 26, 2009 Ok, I've just woken up. You need to install libapache2-mod-php (or similar, eg libapache-mod-php5/libapache2-mod-php4 - you get the idea). Check which version of apache you have first. If apt screams at you, you've probably used the wrong apache version. Apache2 is the default in both etch and lenny, I think. Then, move the configuration for it from mods-available to mods-enabled: mv /etc/apache2/mods-available/php5* /etc/apache2/mods-enabled Do you use aptitude or apt-get? apt-get I'll try that. I've just realised I seem to have apache & apache 2 installed. there's config files for both. pretty sure I only did 1 install apache command. dont really know which one is being used or both or what, thx
powdarrmonkey Posted January 26, 2009 Posted January 26, 2009 You can't have them both, they are marked as conflicting and apt will refuse. If you install aptitude then you can say: aptitude show apache aptitude show apache2 to see which you really have. Generally config files get left behind in case you've customised them and still need them for reference. If you really do have Apache 1.3 still, I would replace it before you do anything else.
browolf Posted January 26, 2009 Author Posted January 26, 2009 You can't have them both, they are marked as conflicting and apt will refuse. If you install aptitude then you can say: aptitude show apache aptitude show apache2 to see which you really have. Generally config files get left behind in case you've customised them and still need them for reference. If you really do have Apache 1.3 still, I would replace it before you do anything else. aptitude already installed. it must be standard in the base image. apparently its just apache 1.3 I have installed. In that case I'm going to start again but install apache2 maybe thats why nothing is working like it ought to lol. Maybe i've forgotten I used to install apache 2.... thank you.
powdarrmonkey Posted January 26, 2009 Posted January 26, 2009 aptitude already installed. it must be standard in the base image. apparently its just apache 1.3 I have installed. In that case I'm going to start again but install apache2 maybe thats why nothing is working like it ought to lol. Maybe i've forgotten I used to install apache 2.... If you just say aptitude install apache2 libapache2-mod-php5 then apt should sort out the conflict for you, remove apache1.3 and set up apache2 and php5's dependencies. Then just activate it as above. If it doesn't, do aptitude remove apachefirst. The whole point of apt is to make managing packages like this really, really easy (though it's also been known to solve puzzles like solitaire, if I can find a link I'll post it. It's very elegant)
browolf Posted January 26, 2009 Author Posted January 26, 2009 If you just say aptitude install apache2 libapache2-mod-php5 then apt should sort out the conflict for you, remove apache1.3 and set up apache2 and php5's dependencies. Then just activate it as above. If it doesn't, do aptitude remove apachefirst. The whole point of apt is to make managing packages like this really, really easy (though it's also been known to solve puzzles like solitaire, if I can find a link I'll post it. It's very elegant) I prefer to and have done started from scratch. its a virtual server anyways so its pretty easy to do. I want to know the process from scratch works and lo and behold, specifing apache2 and php5 , ah everything magically works again.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now