Changing htdocs directory xampp causing error - macos

I'm working on mac 10.6.8 and I've installed xampp and would like to change where the htdocs files are looked for. I have changed the httpd.conf file in the etc folder within xampp
so the lines now read:
DocumentRoot "/WorkArea/folderforhtml"
I've also changed the directory to that folder
Directory "/WorkArea/folderforhtml"
I've put a test.html folder in that file but when I go to my localhost/test.html I'm getting a 403 error. Is there a permission setting I need to change in order to access these files?
I've restarted the server many times as well.

Related

Change localhost/htdocs folder in Xampp 8.2

I know this is not a new question but I think something has changed with Xampp in the latest version. I was using Xampp 8.0 and was using another directory to serve as localhost just fine. My Xampp installation is in C:/xampp while my projects are located in D:\Whip\Projects. This is the folder I want to load when using the address localhost.
I changed 2 lines in httpd.conf like I had done several times before
DocumentRoot "D:\Whip\Projects"
<Directory "D:\Whip\Projects">
The folder loads but PHP doesn't work properly. I get errors related to missing session folders and extensions. The problem is in php.ini file the paths are not absolute anymore. For example, in xampp 8.0 I had
session.save_path="C:\xampp\tmp"
In 8.2 I have
session.save_path="\xampp\tmp"
And same thing with extensions directory and all other paths defined in php.ini (and who knows where else). If I manually add C: to the path above, the sessions start working. I'm apprehensive of changing every path like that. Is there a better way to change the htdocs folder now?

OXID starting on localhost/source, I want to start it at localhost

My OXID store starts on localhost with http://localhost/source, but I just want it to start with http://localhost.
You need to change the DocumentRoot setting in your httpd.conf file. You also have to change the corresponding Directory Setting in the same file. Both should point to the "source" directory. How do I change the root directory of an Apache server?
In your Oxid installation you then have to change the "sShopURL" setting in config.inc.php to http://localhost/, and additionally you have to change "RewriteBase /source" to "RewriteBase /" in your .htaccess file (both of these files are in the "source" directory of your shop).
Remember that you have to remove the write protection from the config.inc.php file in order to edit it. One more Tip: if you are using xampp you can edit the httpd.conf file and restart apache in the xampp control panel.

Xampp redirects to /xampp

I just installed codeIgniter on my xampp but whenever I try to go to it's folder (localhost/ci) , it instead takes me to localhost/xampp
Can't find what else is needed to do.
Rename index.php in your htdocs folder to index1.php,
then try to access http://localhost,
so now you will see Apache's default Directory listing instead of XAMPP homepage.
If you somehow want to move back to the default XAMPP homepage, do rename index1.php to index.php
It's not really necessary to put your codeigniter project in the htdocs folder of xampp. You can also save it somewhere else.
To run it, go to C:\xampp\apache\conf\httpd.conf and replace the line DocumentRoot "/home/user/www" to your liked one.
"index.php" kept in htdocs directory works as redirection.
Open this file with notepad or in other editor.
At this line:
header('Location: '.$uri.'/xampp/');
Replace xampp with the name of your website directory name ie root:
header('Location: '.$uri.'/bulandshahr/');
Your website will work.

OSX: localhost php file works but not other files?

I have a php file named 'db.php' in my folder /Library/WebServer/Documents/ and I can reach it but I have a picture '1.png' in the same folder but I cannot reach it.
Forbidden
You don't have permission to access /1.png on this server.
How come?

'Unable to open WampServer's config file, please change path in index.php file' not opening localhost in browser

Recently I've been using WAMP server for my project. But due to some reason I need to switch to XAAMP server, so I uninstalled WAMP server and installed XAAMP server.
But when I open localhost in my browser it says:
Unable to open WampServer's config file, please change path in index.php file
What might be the problem?
I had the same problem - check your www folder - delete index.php
Edit: The index.php is an unnecessary default home page for Wamp server which will cause the error when running from an XAAMP htdocs folder. In other words, your localhost is working, you've just got an index.php file from the old WAMP install.
you can edit your index.php and if you move it from one place to another, just change it like this:
$wampConfFile = 'c:/wamp/wampmanager.conf';
$aliasDir = 'c:/wamp/alias/';
$vhostsDir = 'c:/wamp/vhosts/';
I got this same error today. I realized I had uploaded my main's localhost index.php instead of the one in my webpage's folder.
So just make sure you're pointing at your correct localhost folder before uploading the index.php. Problem solved!

Resources