![]() If you think anything could be done easier or better in some way, please drop me a comment. This was just a quick tutorial to get your local development server up and running. And remember to do a restart of Apache after each change before you test. So if you have linked folder ~/Dropbox/MySites/SiteA, you have to use chmod on both ~/Dropbox, ~/Dropbox/MySites and ~/Dropbox/MySites/SiteA. To fix this you have to use chmod +x on every folder in the path from user root. Update : You might run into some permission issues with Dropbox. With the following we grant access to the entire Projects folder, but you can be more/less restrictive: Due to some probably quite reasonable security restrictions, we have to grant Apache access to read and serve files from this Dropbox folder. Ln -s ~/Dropbox/Projects/MyWebsite ~/Sites/MyWebsite Let’s say you have a web project in ~/Dropbox/Projects/MyWebsite, let’s create a symbolic link to it in our ~/Sites folder: It would be quite a pain to copy the project to ~/Sites every time we make a change, so why not just create a reference to it? Now we actually want to develop and test some websites locally, and if you are like me, they are all located in Dropbox. To test that PHP is now working, create a PHP test file in your new user level web root (~/Sites) with the following command: Restart Apache for the change to kick in: ![]() Press CTRL+ O and then CTRL+ X to save and exit. LoadModule php5_module libexec/apache2/libphp5.so ![]() Uncomment the first line you find (remove the #): Use CTRL+ W to search within nano and search for “php”. Mavericks comes with PHP 5.4.17, so now we need to turn it on: Now we want to enable PHP, so you can actually develop something. Paste the following config into the Terminal editor: Options Indexes MultiViews FollowSymLinks Then we need to create a new user config for Apache (substitute your own user account short name): We want to create a user level web root for our own projects, and we’ll do it all from the Terminal: The document you are seeing is served from the system level web root, located in /Library/WebServer/Documents. Now you can test that Apache is running by opening in a browser. This will show you the installed version of Apache, which is Apache/2.2.24 on Mavericks. ApacheĪs I said everything you need should already be installed on your new Mavericks machine, so go ahead and and write the following in a Terminal window: how to start it).Īfter this tutorial you will have a working local Apache server with PHP, and I will show you how to create sub sites for each of your web projects directly from Dropbox. Some familiarity with the Terminal is presumed (e.g. Everything you need is preinstalled, and just needs to be configured. This a quick writeup of how to get a local web development server up and running on your Mac. Update : I have created an updated article on how to setup Apache and PHP in OS X Yosemite. ![]() I hope you have found where php.Article by Ole Michelsen posted on Decem, updated November 25, 2014 Each distribution goes their way, but there are few common patterns: OS The location of the file php.ini depends on the installation of PHP. The problem with this command, is that you might find multiple php.ini files, and do not really know which one is the active one. If you suspect your php.ini file is under the directory /etc/, you can substitute “/” for “/etc/”. This command will search for php.ini file in the whole disk, redirecting any error to null. In this example (running Mac OSX 10.6), php.ini is located in /private/etc/php.ini Find it with BASH scriptĪnother pretty safe way to locate your php configuration file (assuming you are running a UNIX system), is with the following BASH command: find / - name 'php.ini' 2 > / dev / null You can find much more details with this function, but in order to locate php.ini, we need to focus only on the field “Loaded Configuration File”. Once you run the script in your favourite browser, the function phpinfo() will output the what you see in the image. The safest way to know it, is through the following script: There are few ways to know where is php.ini file. But where is php.ini hidden? Linux Windows Mac OS X Find php.ini Depending on what system you are running, php.ini could have different locations.
0 Comments
Leave a Reply. |