Creating a new PHP project with WAMP 2.5 - php

I have a directory containing a basic PHP website like so:
website/index.php
website/pages/...
websites/styles/...
I want to use WAMP to run this locally for development purposes. I thought this would be easy, but if I put my website folder in WAMP's "www" directory and click on it in WAMP's "My Projects" section, Firefox gives me a "Server not found" error.
After doing some reading I discovered that apparently a better way to do this these days is using Virtual Hosts, but I was unable to find any clear, official instructions on how to set this up, and the guide I found were either outdated or hugely complicated. Nonetheless I gave it a shot, but I didn't have a clue what I was doing, didn't manage to get it working, and reverted all my changes.
Can anyone offer me a solution, or direct me to some clear instructions? (Thanks.)

I also face this problem and that is solved by doing following steps...
1> open your www folder which is inside wamp folder.
2> open index.php file from that folder
3> At line no 30 change $suppress_localhost = true; to $suppress_localhost = false;
4> Refresh page of localhost and now open project.
DONE.

Related

Xampp not showwing my projects in browser - htdocs folder

I used windows 10 as the operating system and I installed xampp it's been a long time and it chews well, until yesterday after an error in mysql.
So I looked for solutions on the internet and I finally solved the error by copying the files from C:\xampp\mysql\backup to C:\xampp\mysql\data.
then the service mysql is well marketed even as Apache.
PhpMyadmin chews well without a problem. phpmyadmin page shows, but my code, will not show.
The problem is: my old projects exist in htdocs only display "This page does not work" and "localhost" in the title head, and nothing loads from my project files.
Note: I used codeigniter as a framework.
Note: I can navigate to a new project but for existing projects beyond that it no longer works.
Thank you P.al
Use Directly like-
http://localhost/projects/form.html
Here your files should be inside C:\XAMPP\htdocs\Projects\yourfile.html
The error in your picture appear an php script error
Edit php.ini for display error and notice in browser
display_errors = on
save the php.ini restart apache and reload page.

Troubles with XAMPP(or?)

I just started taking a PHP course and I'm having a lot of difficulties. I won't get anywhere unless this is resolved.
I got the course files downloaded and added them to htdocs folder but I can't run any new files I created. I get
Object not found! 404 error
I see them under localhost/coursefiles/whtever.php. I've google searched all day but can't find anyone else having this specific problem.
Would uninstalling and reinstalling XAMPP work? This is extremely frustrating and making me crazy.
First Check xampp manager Is your MySQL and Apache is in running state ?
Then Type Localhost in your browser , if Xampp Homepage is Coming It means Xampp is working Fine!
And again Checj your course files Extension they should have .php extension (if they are php files).
Create An folder In your Htdocs Folder With Abc(for example) and Write in browser's Url window "http://Localhost/Abc
if your Folder is opening and it's showing Files Then There must be a Problem with files! :)

WAMP does not open my project

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
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.
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.
Please make sure that index file exist in your "PaperCloudBackend" directory as it is the entry point of execution.

Netbeans with xdebug not highlighting debugged lines

I finally managed to get xdebug working but now I am facing a strange problem. I can see the variables, I can step through the code but i can't see what line I'm actually debugging. Any ideas?
If you don't see highlighted lines, it's possible that the project settings aren't configured correctly.
E.g. when using a htaccess redirect from the root folder to folder myapplication, be sure to edit Project->Properties->Sources->Web Root to the redirect folder.
That solved the issue for me.
Under Netbeans > Project Properties > Sources, be sure that the Web Root is set right to refer to the directory where the running page is. This could be one of the possible reasons of the problem.
I ran into this same issue, and it was because I did not set up Path Mapping in the project.
Project -> Run Configuration -> Advanced
More info here: https://blogs.oracle.com/netbeansphp/entry/path_mapping_in_php_debugger
In my case what seems to have fixed the problem is to right click the file (in my case a java file) choose "select in projects" then it asked me if I want to open the project (actually this is what I think was happening, I had the file opened but not the project), I said yes and then netbeans started to show me the line as it goes debugging.

Why is Wordpress outputting phpinfo() when I try and go to a page?

I have just moved a Wordpress install from a remote host to run on my local development machine. On the remote server it's fully functional.
However, on my development box I can only load the homepage. Other URLs just load a standard phpinfo() page with no errors.
Does anyone know what might be causing this?
It sounds like you are using MAMP or WAMP on your dev box, which will load a default vhost showing phpinfo for any page that does not exist.
Inside wordpress, the settings, in the DB, it sounds like you have Url's "hardcoded" like "http://www.mysite.com" which are not working locally because your "dev" Url is something like "http://localhost"
Whenever using a development server, especially with wordpress, you should setup you dev server as close to your production server. This means you should edit your host file to make it so "http://www.mysite.com" actually goes to your development box or localhost. That way you are viewing everything as it will be when it goes to production.
I had this problem as well following the hosting company re-installing an SSL certificate.
I did some searching and really only found this thread which give me the idea there was a 404 error hiding there somewhere so I checked the php_errors.log file (which I found in the root folder of my site in FTP) - opened that in notepad and found many errors such as:
PHP Fatal error: Class 'WordPressHTTPS_Module_phpinfo' not found in /var/www/vhosts/mywebsite.com.au/httpdocs/wp-content/plugins/wordpress-https/lib/Mvied/Plugin.php on line 385
So - indeed a missing file in the wordpress-https plugin.
To correct, I renamed the folder which contained that plugin (eg wp-content/plugins/wordpress-https to wp-content/plugins/wordpress-https-disabled) - effectively disabling the plugin.
This then allowed me to login to the wordpress admin, install the latest version of that plugin - which worked fine and then deleted the old folder (wordpress-https-disabled)
Everyting was good as gold after that
Hope that helps someone :)
open httpd.conf in text editor
Change;
AllowOveride none
To;
AllowOveride All
I had the same challenge when I cloned my remote site locally.
I fixed it by checking the .htaccess file and correcting this line to point to the right project folder:
RewriteRule . /wordpress/index.php [L]

Categories