AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() Creating Apache VirtualHostsDefault location for Apache web server project files is /Library/WebServer/Documents/ which is not a convenient place to keep our project files, also we will have to access it in browser with localhost, so I decided to create my own virtual host pointing to my development directory. Free Download NCH DreamPlan Plus 8.21 5.3 Mb Visualize and plan your dream home with a realistic 3D home model. Warning: mysqliconnect function.mysqli-connect: : Access denied for user (using password: YES) in /Users/pankaj/CODE//testdb.php on line 2Failed to connect to MySQL: Access denied for user (using password: YES)Warning: mysqliclose expects parameter 1 to be mysqli, boolean given in /Users/pankaj/CODE//testdb.php on line 10This is some problem with the user creation, check above for the correct syntax for creating the user.Thats all for setting up local Mac OS X environment with basic setup to learn PHP. To enable VirtualHosts, we need to make some changes in Apache Configuration file (nf).Pankajs-MacBook-Pro: root# vi /etc/apache2/nfUncomment below lines and save it.# Virtual hostsInclude /private/etc/apache2/extra/nfNow when Apache will load the configuration file, it will also load the virtual hosts configuration file. We can proceed now to HTTPD virtual hosts file.Pankajs-MacBook-Pro: root# vi /etc/apache2/extra/nfAdd following configuration for a new VirtualHost and save it.ServerAdmin '/Users/pankaj/CODE/'ServerName ServerAlias '/private/var/log/apache2/-errorlog'CustomLog '/private/var/log/apache2/-accesslog' commonAllowOverride AllOrder allow,denyAllow from allMake sure to change the DocumentRoot, ServerName and Directory location according to your needs. ![]()
0 Comments
Read More
Leave a Reply. |