Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Apache and PHP
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="vansmith" data-source="post: 1300909" data-attributes="member: 71075"><p>To enable PHP:</p><p></p><p>Edit the file /private/etc/apache2/httpd.conf and uncomment (remove the # at the beginning) line 111 which looks like the following:[code]#LoadModule php5_module libexec/apache2/libphp5.so[/code]You'll need elevated privileges to do that so you might want to use something like nano or vim from the command line but open it through sudo:[code]sudo nano /private/etc/apache2/httpd.conf[/code]</p><p>That will enable PHP but I just noticed a secondary problem. You're putting files in ~/Sites which means that to access it through a browser, you need to navigate to http://localhost/~<username>/hello.php (replace <username> with your user name).</p></blockquote><p></p>
[QUOTE="vansmith, post: 1300909, member: 71075"] To enable PHP: Edit the file /private/etc/apache2/httpd.conf and uncomment (remove the # at the beginning) line 111 which looks like the following:[code]#LoadModule php5_module libexec/apache2/libphp5.so[/code]You'll need elevated privileges to do that so you might want to use something like nano or vim from the command line but open it through sudo:[code]sudo nano /private/etc/apache2/httpd.conf[/code] That will enable PHP but I just noticed a secondary problem. You're putting files in ~/Sites which means that to access it through a browser, you need to navigate to http://localhost/~<username>/hello.php (replace <username> with your user name). [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Apache and PHP
Top