- Download PHP542.dmg and open it.
- Copy
PHP5folder into/Applications.
$ python virtualenv.py --no-site-packages . $ . bin/activate $ easy_install wphp
$ python main.py
| import os | |
| from wphp import PHPApp | |
| from wsgiref.simple_server import make_server | |
| here = os.path.dirname(os.path.abspath(__file__)) | |
| base_dir = os.path.join(here, "www") | |
| php_script = "/Applications/PHP5/bin/php-cgi" | |
| php_options = { | |
| 'include_path': os.path.expanduser("~/pear/share/pear"), | |
| 'magic_quote_gpc': 'Off', | |
| 'date.timezone': 'Asia/Tokyo', | |
| 'error_reporting': '"E_ALL&~E_NOTICE|E_STRICT"', | |
| } | |
| my_php_app = PHPApp( | |
| base_dir, | |
| php_script=php_script, | |
| php_options=php_options) | |
| httpd = make_server('', 8000, my_php_app) | |
| httpd.serve_forever() |
PHP 5.4.2 package for Mac OS X http://www.aprelium.com/abyssws/php.html