0

I am completely new to web-dev and wamp, I have to use it for a college project to build a website using php. I installed the newest version of wamp. I cloned my project repository into the www folder.

When I run "localhost" in the browser, I get the generic wamp page and I can see my project folder on the bottom of the page under the "Projects" heading

when I click on the project it does not open and I get a 404 not found error. This is not the same issue a thousands other people have written about, where when they uses the path "localhost/projectname" they get access to their project but when they just click their project the path is "projectname" and they dont see their project. I have read tons of posts with people that have that problem and I do not think I have the same issue becase when I click on my project link on the wamp hompage, I get the complete path "http://localhost/PaperCloudBackend/" and this shows a 404 error

Keep in mind that all I have done with wamp so far is: 1) install it 2) clone repo into www folder 3) opened browser with localhost 4) clicked on my project name

I would really like a concise answer to why this is happening so I can learn the root cause, and also a solution to the problem because i have not contributed to my team codebase at all and I have not been able to solve this issue after 1 week.

Thanks

Miladinho
  • 174
  • 2
  • 11
  • 1
    I think this post will help explain why and what to do about it. http://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/23990618#23990618 – RiggsFolly Apr 28 '15 at 08:43

3 Answers3

1

I assume that its an .htaccess error which is clashing . If you have .htaccess in your project then check it if you have given the correct url in the .htaccess rule or you can delete the file(.htaccess) and run the project in your browser. Another problem that you should check is there any index file is present in the root of the folder you are trying to access. I hope this might help you.

  • Our project is using Slim (no idea exactly what this does yet) but i deleted the .htaccess file there, still getting the same error. Thanks for that insight though, it was a good call. The index.php file is definately present in my root file, i even try to add it to my address bar and run it directly but to no avail – Miladinho Apr 27 '15 at 05:45
  • 1
    Since your using slim create the .htaccess file in the root of your project and put this below code/rule in it and try to run `#ErrorLog "logs/mysite.com-error.log" #CustomLog "logs/mysite.com-access.log" combined AllowOverride All Order allow,deny Allow from all ` as well as you have to also midified your apache server to allow .htaccess file follow the below path and instruction ` /etc/httpd/conf/httpd.conf and changed: AllowOverRide None to AllowOverride All` i hope this will help you to solve your problem – karvin.developer Apr 27 '15 at 06:02
  • Hi, I copied the index.php file into the root www folder. I renamed it pp.php since there is already a wamp "index.php" file in the www directory. Now when I insert "localhost/pp.php" I get the same error. Given this new data, do you think that the solution you suggested is still the correct one? Thank you also for your continued help. – Miladinho Apr 27 '15 at 06:28
  • 1
    I will suggest you to create a folder in your www folder and copy your entire repo in it and change the pp.php back to index.php and also create the .htaccess in the root of your repo directory and add the above .htaccess rule . this might sove your problem – karvin.developer Apr 27 '15 at 06:56
  • can you clarify the above htaccess command, its unlear what is a comment and what is actual code. Thanks again – Miladinho Apr 27 '15 at 07:30
  • line starting with the # is comment your .htaccess file will look like this `#ErrorLog "logs/mysite.com-error.log" \n #CustomLog "logs/mysite.com-access.log" combined\n \n AllowOverride All \n Order allow,deny Allow from all \n `\n \n define new line don't put the \n in your .htaccess file just replace the \n with new line or press line break – karvin.developer Apr 27 '15 at 07:34
  • The new lines help, thank you. PS I know not to put the new line char in the htaccess file haha. – Miladinho Apr 27 '15 at 07:58
  • if it helps then please up vote my answer . Thank you @ Milad – karvin.developer Apr 27 '15 at 08:03
1

Currently thats also happed with me on window8.1, To prevent this open the index.php file from root directory wamp/www/index.php.

Change

$suppress_localhost = true;

To

$suppress_localhost = false;

Hope this will help you to fix the problem.

jogesh_pi
  • 9,762
  • 4
  • 37
  • 65
  • Hi, it was originally set to false, I changed it to true, the only thing this did was add the localhost\in the beginning of the path which logically helps because with that line set to false, when I click my project link on the wamp homepage, it will input my project name in all lowercase letter in the address bar and I get a dns look up error. What I am saying is that with $suppress_localhost = true; I think it makes more sense but either way, changing that option did not help me :( – Miladinho Apr 27 '15 at 05:34
0

Please make sure that index file exist in your "PaperCloudBackend" directory as it is the entry point of execution.

Nitin Pund
  • 1,082
  • 2
  • 9
  • 23