How to change file directory on xampp - php

I am trying to change the file directory for XAMPP from htdocs to a different folder. I did go into httpd.conf and change the directory in there like I saw to do from other posts, but it did not work.
When I tried to go to my file from localhost in my browser it would show the folders in the folder, but when I clicked on one, it would say "object not found."
I am unsure of the problem.
Other details:
Where I want it pointed to is on a VHD
that VHD is hooked up to sourcetree (idk if this matters)
Thank you in advance
Edit: This is what I changed
DocumentRoot "P:/projects"
<Directory "P:/projects">

Related

Why my localhost is unable to recognize my htdocs in its directory?

I have a problem with my XAMPP server after uninstalling an old version for a new one. I have a problem with executing PHP codes because when I put "localhost/file.php" it says "Object not found" or put the PHP document despite having the Apache server on.
When I access the XAMPP directory from localhost, it's completely empty despite I stored the site in the htdocs folder. And if you ask, the xampp folder's location is C:/xampp/. And I did put an .htaccess file in my file's directory.
Here's a screenshot:
xampp -> apache -> config -> apache(httpd.conf) and search DocumentRoot and Directory.
see there what link is set.
Giving localhost in the browser address bar refers to htdocs folder.
As we can see the address as localhost/xampp i.e you are refering to htdocs/xampp
if you have stored your file in htdocs root folder, then give the address as localhost

xampp is not showing .php files saved in htdocs folder

I am using windows 7 and just installed xampp server to "E:\xampp" in my laptop to learn php. Now the problem is whenever I start xampp server by starting "xampp_start" in xampp folder and start Apache and MySQL from "xampp-control" and type localhost in my browser it automatically gets converted into "localhost/xampp/" and display a default page instead of displaying the .php file which I created in htdocs folder. Another problem is when I created a folder in htdocs folder and saved a index.php and another .php file which was created by me, it is not showing that folder too. I know this question has been asked before but I didn't get any solution from there because I started xampp_start from xampp folder and Apache & MySQL from xampp-control. So please help. Thanks in advance.
This is the default picture which is being displayed:
Thing is if you create any .php file in htdocs folder, you have to run that file as "localhost/filename.php" but if you created any folder in htdocs, for example folder name is "work" then you have to type "localhost/work/" and then it will show file contained in that folder.
First copy the files of htdocs and paste on any drive and delete the htdocs folder then create another folder and paste the files in this folder and restart the server.
First make sure you go to Local Disk (C:), then go to xampp -> htdocs-> and create your folder.
Hi Guys Here Iam Gonna Show You How You Can Fix This Error
Follow me
Don't worry ! If xampp is not showing .php files in htdoc/folder OK:
Just change the name of that file which is not showing and refresh or reopen the localhost directory it will-be show
Your file
If this method work or not comment below
Good luck and keep it up.
#gamerinc

problem installing CakePHP on Linux

I have downloaded the CakePHP from it's site then I copied the files in srv/www/htdocs
renamed the folder to first_app
Here is the output(error and warnings that shows me):
Release Notes for CakePHP 2.0.0-dev.
Fatal error: Class 'Debugger' not found in /srv/www/htdocs/first_app/cake/libs/view/pages/home.ctp on line 26
also the tutorial tells me that I must have this:
Apache server with mod_rewrite
I didn't know how to find it and install it?
is that causing this problem?
I want to know how to add "another" root without having problem
I used this and no result:
<Directory /srv/www/htdocs/first_app/app/webroot>
Options None
AllowOverride All
Order deny,allow
Deny from all
</Directory>
also I changed the /etc/apache2/server-default.conf
I changed allow override None to Allow override All
in the part of this:
<Directory "/srv/www/htdocs">
chmod -R 0777 /srv/www/htdocs/first_app/app/tmp/
This makes the tmp dir writable for everybody (on your machine) so also for the web server. If you want to limit access, first try this, then browse to your CakePHP install, and then check in the cache dir which files have been created and what's the owner and group of those files.
The tmp dir contains more than just the cache dir, it also contains sessions and logs. Anything outside of /srv/www/htdocs/first_app/app/tmp/ does not need to be writable for the server, anything inside that folder should be writable.
The default CakePHP install comes with .htaccess files. You do need those files. They redirect every request to localhost/first_app (or any other dir your is installed in) into the webroot, so you don't have to do that yourself. You need to have AllowOverride All in your apache config. See here for instruction on how to enable that.
Please Go through these links
http://www.youtube.com/watch?v=9stiBWz71Ts
http://ubuntu-linux-apache-mysql-php.blogspot.com/2008/12/how-to-install-cakephp-on-linux-ubuntu.html
http://groups.google.com/group/cake-php/browse_thread/thread/3ba763933544ece
It may help you.
same problem on mac. on mac, i just right clicked on the directory it was concerned about and changed the permissions so that everyone could read/write, and clicked apply to enclosed files/folders.
I used to use linux but i'm not sure exactly how to do this, but hopefully this will get you on the right track? i assume that the command you posted changes the permissions of that folder, but maybe you need to change the permissions of the files and folders inside.

How to change apache 2.2 htdocs folder out side of apache folder?

Hi I want to store my php project folder out side apache folder. How can I do that?
I changed my DocumentRoot "C:/sbnproj" like this.
after that I created one folder named mytest.php and write
&lt?php
phpinfo();
?&gt
This code on that. But when I try to access http://localhost/
is working but when I type http://localhost/mytest.php is not working. it shows
Forbidden
You don't have permission to access /mytest.php on this server.
Why this happening please help me.
Thanks
You need a trailing forward slash.
C:/sbnproj/
Also, check your paths... if your getting the root page it's working, make sure C:/sbnproj/foldername/ exists.

Zend Studio and localhost - Forbidden error

Okay so basically, I switched my DocumentRoot in Apache2 default to look like this:
DocumentRoot /home/scott/MySite/
That works. I have a file called index.php in that root.
I created a Zend Studio project, pointing to /home/scott/MySite/, and was able to create my project use this line as it's source, modify the .php file and see the change when I navigate to localhost in my browser.
Now, in Zend I created a folder called 'Index', and placed my index.php file in there, because I want to separate my files in the project to things like Database/, Index/, Login/, etc. all different folders. Now, when I navigate to localhost, I get:
You don't have permission to access / on this server.
When I place the index.php file back in the main root it works fine again.
I tried changing the apache2 default DocumentRoot to look like this:
DocumentRoot /home/scott/MySite/Index/
But that doesn't work either. Is there a way to get all this to work and have like my folder structure be able to separate all the logic for the project as well as apache2 still find my index.php and be able to call all the files it calls correctly?
Thanks guys.
Apache is run by www-user which doesn't have the rights to read you home folder. The quick and dirty solution will be to set the persmission to 777 for you home folder

Categories