0

I installed PHP 5.4 on Debian from source and I run php scripts on the PHP Built-in web server with new php features without any error but php scripts do not run with apache2 with new php features.

I did not understand the relationship between php and apache2 completely. So I have a few questions:

  1. I can run php scripts with the built-in php server, so is the built-in web server enough to serve php script without any web server such as apache or nginx ? (If you say no, please explain why. )
  2. How can I use PHP 5.4 with apache2 ?
  3. Why does apache2 not interpret new PHP features even though I installed PHP 5.4 ?
  4. Must I compile apache2 again? If so, why ?
  5. What is the relationship betwen apache2, mod_php module and php ?
3

1 Answer 1

0

I can run php script with built-in php server, so Does built-in web server enough to serve php script without any web server such as apache or nginx ? (If you say no, why? )

  • Yes, but ONLY for development. The built in server is very primitive and not meant for production in any shape or form.

How can I use php 5.4 with apache2?

  • Install via your distro package manager (if available in a repo) - or compile it; I'd highly suggest you install the Apache devel headers for your mpm. Look into the configure option '--with-apxs2' in the documentation which takes an extra step out of configuration for apache.

Why apache2 does not interpret new PHP features although that I installed PHP 5.4 ?

  • If you restarted Apache and it's still running say, 5.3 - then You didn't install or configure it correctly when compiled.

Do I must compile apache2 again , why ?

  • Not enough information to help you out on this

How does process relation among apache2,mod_php module and php ?

  • Without being too winded: Apache configuration loads the php module (a mere 'key' mapped to the module) which is a .so file. Then it associates files of the PHP filetype to be processed with that SAPI.
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .