Apache + PHP On Debian

Hi, i could use some help trying to setup php support on my debian box. Examples of what i mean can be found at http://67.18.92.39/phpsysinfo/ or http://67.18.92.39/lol.php .

Thanks

11 Replies

Your going to have to download php at php.net and configure apache via httpd.conf to enable php. If you want to save some time, deploy the Red Hat 9 Large image and just start apache with:

> service httpd start

PHP and MySQL are configured by default.

@Husam:

Hi, i could use some help trying to setup php support on my debian box. Examples of what i mean can be found at http://67.18.92.39/phpsysinfo/ or http://67.18.92.39/lol.php .

Thanks

apt-get install php

apt-get install php-mysql

apt-get install libapachephp (or something like that)

I had done all that prior to my first post, and I would rather not switch to red hat for such a small thing.

If you have already compiled/installed PHP and Apache from their web sites, I suggest you remove them before doing this.

This command should fix everything:

apt-get update
apt-get install php4 php4-mysql apache

It should ask you if you want to add the PHP module to the apache configuration, if NOT add the following to /etc/apache/httpd.conf:

LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

You have to remember that Apache on Debian won't start until a hostname is set:

echo youthostname > /etc/hostname
/bin/hostname -F /etc/hostname

Then reboot the server and evrything should work.

have u looked at xampp? easy to install and admin.

http://www.apachefriends.org/en/xampp-linux.html

just follow the steps and take note of security procedure at the bottom of the pg.

maven

maven - thanks, that helped a ton.

Perhaps this is a dumb question, but ain't php up to version 5? Or is it that the Debian binaries are only @ 4? Or is there something bad about version 5? I'm running 5.0.4, so I'm kinda curious :)

EDIT: the post that makes reference to php4 also refers to Apache 1. My bad ;)

-Brian

@absolutefunk:

Perhaps this is a dumb question, but ain't php up to version 5? Or is it that the Debian binaries are only @ 4? Or is there something bad about version 5? I'm running 5.0.4, so I'm kinda curious :)

I don't know of any popular distros that are installing PHP5 by default now instead of 4. Given there are PHP5 packages for all said distros, but a lot of scripts haven't been tested against PHP5, and it's not really considered a stable move yet.

@absolutefunk:

Perhaps this is a dumb question, but ain't php up to version 5? Or is it that the Debian binaries are only @ 4? Or is there something bad about version 5? I'm running 5.0.4, so I'm kinda curious :)

EDIT: the post that makes reference to php4 also refers to Apache 1. My bad ;)

-Brian

PHP 5 uses a slightly diffrent syntax for OOP, which affects many scripts such as phpbb, IPB, vB etc. Because of that, PHP 4 is more suited for a production enviornment while 5 is more suited for a development enviornment.

> PHP 5 uses a slightly diffrent syntax for OOP, which affects many scripts such as phpbb, IPB, vB etc. Because of that, PHP 4 is more suited for a production enviornment while 5 is more suited for a development enviornment.
Slightly different? :roll: OOP in PHP5 is completly rewritten and close to Java while in PHP4 it was barely existing. I've been coding in php5 since its first alpha stage in the beginning of 2003. It even has a Reflection API and a growing SPL.

PHP5 is not for development. In fact, PHP5 is a lot more productive than PHP4 for those who know OOP. It is also faster in most cases because of the improved memory management. Most people stick to PHP4 either because of old php code or simply because the new PHP5 is much harder to handle, although most php4 scripts run fine in php5 as well. PHP4 still remains at the level of scripting language rather than a programming language and that is why it was so popular … too easy to learn :)

@mastabog:

> PHP 5 uses a slightly diffrent syntax for OOP, which affects many scripts such as phpbb, IPB, vB etc. Because of that, PHP 4 is more suited for a production enviornment while 5 is more suited for a development enviornment.
Slightly different? :roll: OOP in PHP5 is completly rewritten and close to Java while in PHP4 it was barely existing. I've been coding in php5 since its first alpha stage in the beginning of 2003. It even has a Reflection API and a growing SPL.

PHP5 is not for development. In fact, PHP5 is a lot more productive than PHP4 for those who know OOP. It is also faster in most cases because of the improved memory management. Most people stick to PHP4 either because of old php code or simply because the new PHP5 is much harder to handle, although most php4 scripts run fine in php5 as well. PHP4 still remains at the level of scripting language rather than a programming language and that is why it was so popular … too easy to learn :)

I think he was more going for PHP4 is more proven and therefore better for 'downtime = $50k/minute' situations then PHP5 :)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct