![]() ![]() ![]() Since you are working on your local machine, you do not have to upload files using the Ctrl – Shift – U keyboard shortcut in Dreamweaver.This will be the Local Site Folder when configuring your site in Dreamweaver. Create a sub-folder in your User Root directory named PHPBA.The last bit of information here is a list of recommendations on how to set up your Sites folder to complete the workshop. This concludes what is needed to move through PHP: The Basics in self-study mode. You should now see the PHP installation information. To test the PHP configuration, in a Web Browser, navigate to:.This will create the file, now let’s add the code. To create the PHP information file, in Terminal, type:Īgain, replace username with your short username.Now that we have PHP configured, let’s test the installation by creating a php document that contains the phpinfo() function in our User Root directory. Now that the line is uncommented, let’s restart Apache to have the changes take affect. Remove the octothorp (#) from the beginning of the line Now, we will use nano’s built-in search functionality to find the line that talks about PHP. To open the nf file, in Terminal, type:.This is done by uncommenting a line in the Apache configuration file located at /etc/apache2/nf. Now that Apache is running, we need to start PHP. ![]() Replacing username with your short username.Īpache is now configured to look in /Users/username/Sites when we browse to Let’s restart Apache and configure PHP. To change the permissions of the file, in Terminal, type:.To add the XML needed to configure the User Root, type:Īgain, replacing username with your short username.īefore we are finished, let’s make sure the file has the correct permissions.Replacing username with your short username.The nano editor launches with a new file called nf. To do this, we need to create a file called nf and add some XML to that file. If you do not know your short username, in Terminal, type: whoami and press return.Now that we have a User Root directory for all of our sites, let’s tell Apache where to find them. Where username is replaced with the short username of your account. To make the appropriate directory, in Therminal, type:.To begin this process, let’s set up a folder called Sites in our user directory. We will create a folder inside our own user directory that will contain all of our sites. This is not a good place to do our work since it’s in the root level of the operating system. When we navigate to the files in this directory are displayed. If apache has started, you should see a web page that says “ It works!“īy default, this will make your document root be /Library/WebServer/Documents. These commands will be useful throughout your time working with apache. httpd -v - shows the current version of Apache (Apache 2.2.22 comes installed with Mac OS X 10.8 Lion).sudo apachectl graceful - restarts the Apache service.sudo apachectl stop - stops the Apache service.Now that Apache has started, let’s take a moment to review some other useful Terminal commands for Apache. To start Apache, type: sudo apachectl start.This will launch Terminal to your home directory: This is built in to the operating system, but it’s not accessible by any of the graphical interfaces available. Configuring Apache for Mac OS X 10.8 Lion Instructions for that topic will be included in another post. Specifically, this post will not detail what needs to be done to set up MySQL and phpMyAdmin to administer a MySQL database. This instruction set is also focused primarily on the setup needed to complete PHP: The Basics. If you need help with another OS version, leave a comment on this post. The instructions listed here will work on most of the recent versions of Mac OS X. This tutorial is written for the most recent (at time of writing) version of Mac OS X, 10.8 Lion. If you are planning on developing PHP applications on Mac OS X, you’re in luck! Most of the tools come built-in to the operating system all we need to do is activate them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |