![]() If you see content under the Variables, Call Stack and Breakpoints tab, then it worked. Right click on the project in the “Project” Section on the left and click “Debug” This will replace the number 3 with a red square. ![]() Click on that number to set a break point for debugging. In the code, next to the line “echo phpinfo() there is a number 3. Paste the following code into the index.php page: Run As: Local Web Site (running on local web server) Sources Folder: /Library/Webserver/Documents/test Php 5 Interpreter should be: /usr/bin/phpĬlick okay. Go to: NetBeans>Preferences in the top menu bar Now, test if Xdebug is working with NetBeans: If XDebug installed provides a version number, it works! Using Command+A, select everything on the page (all the text and images) (see “Select All Screenshot” for a visual)Ĭlick inside the large white box in the page, and paste using Command+V (see “Paste Screenshot” for a visual)Ĭlick the “Analyse my phpinfo() output” button Next, we are going to verify that Xdebug was installed properly. Scroll through the page and search for “xdebug” In Safari, navigate to “localhost/index.php”, (as done in Step 4) Zend_extension=”/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so” In that folder, open php.ini with Text EditĬopy and paste the following lines of code to the end of the file In the dialog box that appears, enter: “/private/etc/“ (without quotes) ![]() From the drop down list, select: “Go to Folder” In Finder, in the top menu bar, click on the menu header: “Go”. ![]() XDebug is already installed in the computer, you simply need to enable it. XDebug is needed to debug issues with code If you see a phpInfo page, then PHP is functional In your web browser, navigate to: localhost/index.phpĤ. Copy the attached “index.php” file to this folderģ. Navigate to /Library/WebServer/DocumentsĢ. Test that the PHP server is functional by:ġ. PHP is needed to test PHP functionality in the web pages The root of the Apache Web Server folder is: /Library/WebServer/DocumentsĬhange the permissions on the above mentioned Documents folder by right clicking on it, then click Get Info, then in the opened dialog box: click on the icon of a lock and input password, then under the Sharing & Permissions tab at the bottom, provide Read & Write Privileges to everyone who appears in the box. Test that Apache is properly installed by navigating to “localhost” in Safari Activate the built-in Apache Server on the MacĪpache will provide a local server we can use to test websites. Install NetBeans for HTML5 & PHP from this link:ģ. NetBeans is the IDE used for programming. For that, bellow line should be as the first line of your nginx configuratioin file (replace accordingly).The following are instructions for setting up a development environment on a Mac that can be used for HTML, PHP and MySQL. ![]() In order to avoid getting the 403 error, we should grant proper permission to Nginx. To do that, open the nginx configuration file vim /usr/local/etc/nginx/nf Well, lets modify the configuration so that we can access the website using URL. The default nginx page is something similar to bellow. Now, the web server is ready and you can access it using as the default port for nginx is 8080. You can simply install and start nginx on mac using bellow commands respectively. And it can be used to do lots of things like revers proxis, load balancing etc. Nginx is a lightweight powerful web server which can be configured easily. Bellow command is used to install homebrew as stated in their official page. Homebrew is a widely used package manager for mac-os which helps you to install various unix packages. But you can select any version you prefer to install. I will discuss how to install nginx, MySQL and Php 7.3. Unlike in Windows, it is perfectly posible to easily configure customized local web server in mac os with the exact versions of softwares you need. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |