localhost - php file problem
Posted by: shankar.nstl (112.133.233.---)
Date: September 22, 2014 01:20PM

I am a beginner to use the WAMP server.

In my windows pc I have installed WAMP server.

I changed the port number for local host as 9000.

But when I try to open any php file through localhost browser, the browser showing NOT FOUND.

I am not understanding how to get out of the problem.

Hope i Will get solution here.

Options: ReplyQuote
Re: localhost - php file problem
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: September 22, 2014 01:47PM

Why did you change the port number used by Apache to 9000?

9000 is actually bad number to pick as this is used XDEBUG which is another feature added by WAMPServer.


Anyway it is best to leave the port number as 80 unless you have a serious reason to change it.

If you must change the port try 8000, and remember that you will have to add the port number to your url's like so:

'http://localhost:8000' ( without the single quotes )

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: localhost - php file problem
Posted by: shankar.nstl (112.133.233.---)
Date: September 23, 2014 07:48AM

Thank you RiggsFolly

When the .php file was not recognised by the localhost 80, I tried with different port number like 9000. I am supplying the whole address on the local host addressbar, still it could not open the .php file. Please provide solution for this.

Options: ReplyQuote
Re: localhost - php file problem
Posted by: shankar.nstl (112.133.233.---)
Date: September 23, 2014 08:49AM

Dear RiggsFolly

By going through this forum's earlier solution to some similar type questions, I tried the following

mime_module ticked in the apache module

addtype application/x-httpd-php .php also in enable condition

in php.ini

engine on

short_open_tag = on

still .php file is not opening from localhost.

When I tried, it shows on the browser that Not Found

Options: ReplyQuote
Re: localhost - php file problem
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: September 23, 2014 10:25AM

Lets just check everything from the beginning.

1. You should not have to change any config to get a php script to run.

2. The location of the folder used by the localhost domain name is \wamp\www but you should not change anything in that folder. Instead make a subfolder and place your test script in there
EG
\wamp\www\project1\test1.php

3. To launch a script called test1.php from a subfolder of \wamp\www\ called \wamp\www\project1\test1.php you would use this address in the browsers address bar
'http://localhost/project1/test1.php'   (without the single quotes)
Assuming you have returned the port number used by Apache to port 80, otherwise use
'http://localhost:9000/project1/test1.php'   (without the single quotes)


4. A PHP script must have the .php extension to run properly. Be careful some simple editors, like notepad, add the .txt extension even if you save the file as test1.php, and you will actually be saving the file as tes1.php.txt and this will not run. Use something like notepadd++ if you are still using notepad, its free and very good.


5. You must run the script by entering the address in the address bar of your browser. Double clicking on the file name in Explorer ( File Manager ) will not do this correctly. That only works for vanilla HTML and/or javascript.

6. You should have this entry in your HOSTS file located in C:\windows\system32\drivers\etc\hosts
127.0.0.1 localhost
::1   localhost

7. The WAMPServer icon that sits in the system tray (wampmanager) should be GREEN, if it is Red then neither Apache or MySQL services have started. If it is Orange, then one of these services has not started.


?? What colour is your wampmanager icon??

If none of these fix your issue please answer the questions on the Syticky post called READ THIS BEFORE YOU ASK A QUESTION

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 09/23/2014 10:26AM by RiggsFolly.

Options: ReplyQuote
Re: localhost - php file problem
Posted by: shankar.nstl (112.133.233.---)
Date: September 23, 2014 02:24PM

Dear RiggsFolly


Versions

Windows OS --- XP

wampserver--- 2.2

MYSQL---5.5

Apache---2.2

PHP---5.5

host file is there in C:/windows/system32\drivers\etc\hosts

I tried with your suggestions but still the .php file is not recognising the localhost.

When I tried to open by http:/localhost:9000/
its showing project folders but the .php extensions are showing as .php.txt

Kindly provide solution

Options: ReplyQuote
Re: localhost - php file problem
Posted by: shankar.nstl (112.133.233.---)
Date: September 23, 2014 02:25PM

wampserver colour is in green

Options: ReplyQuote
Re: localhost - php file problem
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: September 23, 2014 02:56PM

Ok Shankar,


You said :
When I tried to open by http:/localhost:9000/
its showing project folders but the .php extensions are showing as .php.txt


SEE POINT 4 OF MY PREVIOUS POST I already covered the required extension and the issues caused by using editors that are not up to the job.


If you cannot be bothered to read the answers you are given then there is little point in me bothering to spend my time helping YOU solve problems that are nothing to do with WAMPServer, and more to do with your inexperience.



Dont use a crappy editor like notepad.exe, download a decent editor and if you cannot afford to pay for one use NOTEPAD++ downloadable from here FOR FREE

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: localhost - php file problem
Posted by: shankar.nstl (112.133.233.---)
Date: September 24, 2014 11:20AM

Thank you very much. I have downloaded the Notepad++ and now working fine.

Options: ReplyQuote


Sorry, only registered users may post in this forum.