I have my xampp instalation up and running.
I have a php file with just
<?php
echo"Hello World";
?>
This I can see in my browser when I place it inside C:\xampp\htdocs
But if I place it inside C:\xampp\htdocs\myfolder I get an error 500 server not found.
What's wrong with putting my file inside myfolder? Is that because of Vista? Any advice?
Thanks a lot
First off I'd try restarting Xampp services via the Xampp Control Panel (especially Apache). If the problem is still there check xampp\apache\logs for errors. Depending on how familiar you are with Xampp I'd check to make sure the Apache service is running (Control Panel -> Administrative Tools -> Services), restart it manually and test again.
I'm pretty sure I've had a similar issue to this in the past with Xampp when my computer crashed while Apache was running, which I think I only managed to solve by reinstalling Xampp though. Good luck
You're placing it in the wrong directory.
C:\xampp\myfolder\htdocs
If you want to access the file you should put it under the htdocs directory.
Do this instead
C:\xampp\htdocs\myfolder\
Have you checked the access rights of the folder? Maybe it is not accessable via localhost. Windows 6+ is very strict related to accessing directorys. If you can't find it then set the UAC to a lower lewer to test it, if you think it's safe enough.
Related
I cant see my xampp settings: using this URL http://localhost/xampp/
This is the result im looking for:
I dont know why but if i look at examples, everyone's URL looks like http://localhost/xampp/ if i use this Url i get a page saying:
Object not found! The requested URL was not found on this server.
The directory is located in C:\xampp, and if i just add http://localhost/ as domain i get the tree structure of everything within C:\xampp\htdocs.
Also using Xampp v3.2.2 , if im in control panel and click on the Apache Config tab it open my file structure as mentioned above everything within C:\xampp\htdocs.
I just want to mention im using Windows, not Mac, but i meen both windows and mac has these Apache settings afcourse, i just dont get it how i cant find it using http://localhost/xampp/.
Apache & MySQL is switched on.
What i think could be the problem:
Could it be that im missing the /xampp directory within the /htdocs directory ?
Im not sure if there should be a xampp directory in htdocs but its the
only thing that makes sense?
Possible reason: Something is running with port 80
when you run Xampp, check the apache port no. ex: if it is displaying port 8012
then your url is http://localhost:8012/dashboard/
Check Directories for Xampp
Xampp directories.
more about this topic
For check all dependencies in the : httpd-xampp
The only reason i see is the xampp file should be located in the htdocs folder at least that is how i have it.
However i do not think that this will cause a problem for you in developing anything.
Hope this was helpful :)
So I want to use Xampp to control my servers. I already installed Apache2 and now it orverrides localhost.
Whenever i put localhost/xampp/index.php it says OBJECT NOT FOUND.
How would I delete this Apache program, and strictly use Xampp on localhost?
I already tried to change the .conf file to Listen 8000 and when to http://localhost:8000/xampp/index.php
Steps:
Open "XAMPP controll panel and run Apache and MySQL"
create folder www inside xampp\htdocs, if you are on win propably C:\xampp\htdocs, so now you have C:\xampp\htdocs\www\
Create test.php inside C:\xampp\htdocs\www\, now you have C:\xampp\htdocs\www\test.php
Put inside test this: <?php echo 'php works fine.'; ?>
Run this script in browser on link "http://localhost/www/test.php" you will see "php works fine.".
DONE.
Have you started apache by opening up Xampp control panel? If you didn't then it won't work. So open up Xampp control panel from the start menu and click on start where it says apache and then run http://localhost to see whether it works.
Have a look at the :
\xampp\apache\logs\error.log
This might give you an idea, why the XAMPP splash screen cannot be found.
Also, make sure you do not have any IIS or similar programs running, as they might have a conflict with the XAMPP.
You can also check if the port is open or not using the instructions given here..
Cheers.
I might be wrong, but it seems to me that everything on localhost is coming from htdocs, but you don't call it from htdocs in the URL.
i have another question. I am using WAMP as my local server. I have this file index.htm. The problem now is when I try to edit this file and reload localhost in the browser nothing' changed. But when i double click the html file to open it without WAMP server it diplays the edited one. I don't know why..
it's working now. I only have to put all files inside WWW folder and not inside another folder. Thanks everybody for the help..
Check that the index.htm is in the correct (WAMP) directory (usually c:\wamp\www)
Check WAMP is running
Personally i use XAMPP for mac (they have a windows version too) and place your Websites in /Applications/XAMPP/htdocs/ and access them via (http://localhost/) or you put your Websites in the Sites-Folder in your Home and access them via (http://localhost/~username/).
Obviously if you use windows the paths will be different, but XAMPP will provide you with a help screen on first boot.
So I had installed Wamp and had it running fine. I just fired it up today and noticed it isn't working properly.
Lets say I want to view the files in the game folder.
so http://localhost/game/index.php
what it seems to do is go to http://game/index.php and misses the localhost part.
Another thing I noticed is in the Apache logs.
it shows cann't find file F:\wamp\www\fav.jpg
but the fav file is in the game folder.
So it's making me wonder if some where some paths are not set correctly?
Even the index.php cannot load the database, even though the tables exit and have the correct database logins.
Although i bet it isn't your problem, are you running Skype while trying to use WAMP? If so, then that's the problem because they both use the same ports.
If your Wamp Server Model is Wamp Server 3.0.6, just right click it, then point your mouse to Wamp Settings and enable Add localhost in url... this should work
You can update "urlAddLocalhost" variable in "wamp64/wampmanager.conf" file to on/off. By default it is "off".
My wamp version is 3.0.6.
urlAddLocalhost = "off"
I want to start learning php, I install apache 2.2 and I want to run my first.php file, I look for www folder in the installation folder of ApacheSoftwareFoundation but I couldn't find it.
here's the files in the apache
I tried to put my php file in htdocs but it doesn't work , can some one help ?
Edit
Doesn't work means when I make http:localhost/first.php , returns Unable to connect
Now the apache is running, when I open htt'://localhost/
returns "it works"
but when I open any php file, it opens as-is ?!
You'll need to check a couple of things...
Make sure the Web Server is running ,either the service
or the program, is running and that you have the correctly configured the Virtual Directories.
If the web server just outputs the
content of the .php file, it could
mean that you don't have mod_php
installed. Meaning the server does
not have the Mime type registered so
it will just try to treat it as a
text file ...
And as your on windows you might consider using something like XAMPP. It gives you a Full Working AMP (Apache Mysql Php) Stack with one install and a easy control manager to start/stop the servers. Other wise do a couple of Google searches on how to install the php module for your Web Server on Windows
Update
To start the server try executing the executable bin/httpd.exe .
Now the apache is running, when I open
http://localhost/ returns "it works"
but when I open any php file, it opens
as-is ?!
A default installation of Apache on windows does not include the necessary modules to run PHP. After installing Apache, you must either:
Install PHP separately and follow the instructions described here to configure Apache to use the installed version of PHP to serve .php files. I've been through this and took me hours to get every thing to work.
Recommended for you: uninstall Apache; install WAMP instead.
if you look in your httpd.conf file you will find the default root directory, it doesnt have to be called www. It is the htdocs by default.
error 500 covers a whole host of things. from compile error, to permissions.
Have you put a simple file of
<?php
echo "test";
?>
As your test php page to rule out other issues?
You need to:
Construct your URI correctly: http://localhost/first.php (with the //)
Ensure that Apache is running
all files in htdocs can be referenced from outside
Just put a basic file named index.php
and visit site http://localhost/
In general type in http://localhost/filename
You say that you get a connection error when you try to go to your webpage. Since it looks like you're using Windows Vista or 7, make sure you're running Apache as an administrator; it can't bind to port 80 otherwise. Also check that other programs like Skype aren't binding to port 80. If you still can't find the problem, check the error log. (logs/error.log by default I think)
The problem is that Apache was installed but not started
If you are using xampp start it and then start apache through control panel
for others look for similar instruction