README 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. WHAT IS THIS?
  2. This module exploits the layered I/O support in Apache 2.0.
  3. HOW DOES IT WORK?
  4. In Apache 2.0, you have handlers which generate content (like
  5. reading a script from disk). The content goes then through
  6. a chain of filters. PHP can be such a filter, so that it processes
  7. your script and hands the output to the next filter (which will
  8. usually cause a write to the network).
  9. DOES IT WORK?
  10. Currently the issues with the module are:
  11. * Thread safety of external PHP modules
  12. * The lack of re-entrancy of PHP. due to this I have disabled the 'virtual'
  13. function, and tried to stop any method where a php script can run another php
  14. script while it is being run.
  15. HOW TO INSTALL
  16. This SAPI module is known to work with Apache 2.0.44.
  17. $ cd apache-2.x
  18. $ cd src
  19. $ ./configure --enable-so
  20. $ make install
  21. For testing purposes, you might want to use --with-mpm=prefork.
  22. (Albeit PHP also works with threaded MPMs. See Thread Safety note above)
  23. Configure PHP 4:
  24. $ cd php-4.x
  25. $ ./configure --with-apxs2=/path/to/apache-2.0/bin/apxs
  26. $ make install
  27. At the end of conf/httpd.conf, add:
  28. AddType application/x-httpd-php .php
  29. If you would like to enable source code highlighting functionality add:
  30. AddType application/x-httpd-php-source .phps
  31. That's it. Now start bin/httpd.
  32. HOW TO CONFIGURE
  33. The Apache 2.0 PHP module supports a new configuration directive that
  34. allows an admin to override the php.ini search path. For example,
  35. place your php.ini file in Apache's ServerRoot/conf directory and
  36. add this to your httpd.conf file:
  37. PHPINIDir "conf"
  38. DEBUGGING APACHE AND PHP
  39. To debug Apache, we recommend:
  40. 1. Use the Prefork MPM (Apache 1.3-like process model) by
  41. configuring Apache with '--with-mpm=prefork'.
  42. 2. Start httpd using -DONE_PROCESS (e.g. (gdb) r -DONE_PROCESS).
  43. If you want to debug a part of the PHP startup procedure, set a
  44. breakpoint on 'load_module'. Step through it until apr_dso_load() is
  45. done. Then you can set a breakpoint on any PHP-related symbol.
  46. TODO
  47. PHP functions like apache_sub_req (see php_functions.c)
  48. Source Code Highlighting
  49. Protocol handlers