To do so, we'll edit the Apache Configuration again. The first VirtualHost is important as it behaves like the default Apache configuration and used when no others match. For ease of development, I also configured some custom logs. Note : I use the extension local. This avoids conflicts with any real extensions and serves as a reminder I'm in my local environment. Note: You will need to create a new VirtualHost and edit your hosts file each time you make a new local site.
You may receive Forbidden when you visit your local site. This is likely a permissions issue. If you are not familiar with permissions, read more. For now though, the easiest thing to do is ensure your web directory has permissions of You can change permissions with the command:. Which by default is only readable by me. Note : There are many ways to solve permission issues. I have provided this as the easiest solution, not the best. I won't go into the details. Read the installation guide for more information.
I install utility applications in the default directory. A local development environment is a mandatory part of the Software Development Process. The most interesting part is that Mac OS comes with the Apache web server and we just need to start it and make some changes to setup our development environment.
In this location, you all can create your application in order to host your web applications. To enable VirtualHosts, we need to make some changes in the Apache Configuration file httpd. Make sure that you change your DocumentRoot, ServerName and Directory location according to your needs.
Now restart the server and it should be able to process PHP files. You could stop here. Not ideal for a local development environment. To run sites individually you need to enable VirtualHosts. To do so, we'll edit the Apache Configuration again. The first VirtualHost is important as it behaves like the default Apache configuration and used when no others match.
For ease of development, I also configured some custom logs. Note : I use the extension local. This avoids conflicts with any real extensions and serves as a reminder I'm in my local environment.
Note: You will need to create a new VirtualHost and edit your hosts file each time you make a new local site. You may receive Forbidden when you visit your local site. This is likely a permissions issue. If you are not familiar with permissions, read more. For now though, the easiest thing to do is ensure your web directory has permissions of You can change permissions with the command:. Feel free to use TextEdit if you are not familiar with vi. You can verify this from your Apache configuration.
However there are other commands that are helpful such as mysqldump. Note : You will need to open a new Terminal window or run the command above for your path to update.
While this isn't necessary, it's good practice. There are several options to do so. I do the following:.
0コメント