Author |
|
j0511
Joined: 11 Jun 2024 Posts: 7 Location: Commerce Township
|
Posted: Thu 20 Jun '24 23:05 Post subject: How to uninstall and fresh install of PHP and Apache? |
|
|
Hi all,
I hope you are having a great day!
I recently learned how to code HTML and PHP, and I wanted to use apache to practice my programming, to be able to execute my PHP programs. I am very new to working with apache or anything related, and while I tried to follow some tutorials to set up apache and get it working, I was not successful.
I am working on a windows 11 and using the newest release of Apache, downloaded from the site directly (iirc, 2.4?).
I also downloaded PHP directly, version 8.3.7.
Since I was not able to setup Apache correctly, could you all please guide me on how to uninstall PHP and apache, and do a fresh install? I am quite new to all of this so I want to make sure I do it correctly.
Here is what I have done so far:
1) open command prompt and navigate to C:\Apache24\bin using cd.
2) httpd -k uninstall, and I received this message:
[Thu Jun 20 16:00:12.097963 2024] [mpm_winnt:error] [pid 36324:tid 368] (OS 2)The system cannot find the file specified. : AH00436: No installed service named "Apache2.4".
Does this mean I have already uninstalled Apache? Do I just need to go under my C drive in file explorer and delete the PHP and apache24 folders?
Thank you! |
|
Back to top |
|
James Blond Moderator
![](images/avatars/3066243e8d00d4770e.gif)
Joined: 19 Jan 2006 Posts: 7342 Location: Germany, Next to Hamburg
|
|
Back to top |
|
j0511
Joined: 11 Jun 2024 Posts: 7 Location: Commerce Township
|
Posted: Mon 24 Jun '24 1:18 Post subject: |
|
|
Hi James,
Thanks for the help so far. I am following the tutorial, and on the step after I navigate to bin folder of Apache (I did unzip to C:\Apache24).
I typed httpd in my command prompt (running as admin) and I receive this error: "AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::6bc9:f0ff:4847:a9ce. Set the 'ServerName' directive globally to suppress this message".
I have no idea what this means. Could you provide some guidance, please?
Thanks! |
|
Back to top |
|
James Blond Moderator
![](images/avatars/3066243e8d00d4770e.gif)
Joined: 19 Jan 2006 Posts: 7342 Location: Germany, Next to Hamburg
|
Posted: Mon 24 Jun '24 16:28 Post subject: |
|
|
Somewhere in the httpd.conf there is
#ServerName
change that to localhost or the name of your computer
ServerName localhost |
|
Back to top |
|
j0511
Joined: 11 Jun 2024 Posts: 7 Location: Commerce Township
|
Posted: Thu 27 Jun '24 2:12 Post subject: |
|
|
I did change that line to "ServerName localhost" (without quotes), and I received this error in command prompt:
(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address [::]:80
(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
I tried troubleshooting, and found a StackOverflow post that said to "Confirm if some other process is already listening to Port 80." They suggested using this command: "netstat -aon | findstr :80".
I tried that and got this result in command prompt:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 22396
TCP 127.0.0.1:8088 0.0.0.0:0 LISTENING 28736
TCP 192.168.1.187:54961 192.229.211.108:80 CLOSE_WAIT 13912
TCP [::]:80 [::]:0 LISTENING 22396
Could you please guide me from here? Or was that StackOverflow post indeed the right solution?
Thanks again! |
|
Back to top |
|
James Blond Moderator
![](images/avatars/3066243e8d00d4770e.gif)
Joined: 19 Jan 2006 Posts: 7342 Location: Germany, Next to Hamburg
|
Posted: Thu 27 Jun '24 9:17 Post subject: |
|
|
The last part of the netstat query is the PID of the process. You should be able to find that in your task-manager.
On Windows 10 there is sometimes an error that port 80 is blocked, it might be W3SVC service. Set it to "manual" starting.
Code: |
french name is: "Service de publication World Wide Web"
english name is: "World Wide Web Publishing Services"
german name is: "WWW-Publishingdienst"
Polish name is: "Usluga publikowania w sieci WWW"
Russian name is "Служба веб-публикаций"
|
|
|
Back to top |
|
Otomatic
![](images/avatars/24455e7e39169050f.png)
Joined: 01 Sep 2011 Posts: 195 Location: Paris, France, EU
|
Posted: Thu 27 Jun '24 15:57 Post subject: |
|
|
Hi,
- Do you have Skype installed or running?
- - If so, it is imperative to change the Skype configuration to NOT use port 80 or 443.
- - Do this by starting SKYPE and using the menus do - Tools -> Options -> Advanced Settings -> Connection:
- - Uncheck "Use ports 80 and 443 as an alternative."
- The Windows 10 tiled app versions of SKYPE may not allow you to change this, so uninstall the tiled app and install SKYPE from a download, it will work just the same, but it will also allow you to make the above configuration changes.
- Do you have IIS installed?
Control Panel, Programs and Features, Turn Windows features on or off
(W10) Uncheck :
-- Main Web Internet service instance (IIS)
-- All items of the branch : Internet services(IIS)
-- All items of the branch : Activation Windows service process
(W10/W11) Uncheck :
-- Main instance Web of Internet Information Services (IIS)
-- All items of the branch : Internet Information Services
- In the Windows\System32\drivers\etc\hosts file, there should only be active lines (without # at the beginning):
Code: | 127.0.0.1 localhost
::1 localhost |
|
|
Back to top |
|
j0511
Joined: 11 Jun 2024 Posts: 7 Location: Commerce Township
|
Posted: Sat 29 Jun '24 2:03 Post subject: |
|
|
James, Otomatic,
Thank you both! Turns out the problem was my hosts file. It had extra code besides what you mentioned from a previous setup I had tried for a different program.
I'll keep proceeding along with the tutorial, and I will ask if I have any more questions. Thanks again! |
|
Back to top |
|
j0511
Joined: 11 Jun 2024 Posts: 7 Location: Commerce Township
|
Posted: Sun 30 Jun '24 4:28 Post subject: |
|
|
Hello again!
I have another question. On the step where you say "FIND the extension_dir directive and change so that it properly locates the EXT folder. Enter a full path."
In the php.ini file (which I renamed, initially the PHP ini-prod file), there are 2 lines beginning with extension_dir, and one says "on Windows". I am on a windows computer, so should I only edit that line? Or do I edit both? I have attached a screenshot.
Thanks!
![](https://i.ibb.co/Khk9LC2/extension-dir-question.png) |
|
Back to top |
|
Otomatic
![](images/avatars/24455e7e39169050f.png)
Joined: 01 Sep 2011 Posts: 195 Location: Paris, France, EU
|
Posted: Sun 30 Jun '24 15:47 Post subject: |
|
|
Hi,
Full path to extension directory like:
Code: | ; On windows:
extension_dir ="E:/wamp64/bin/php/php8.3.8/ext/" |
|
|
Back to top |
|
j0511
Joined: 11 Jun 2024 Posts: 7 Location: Commerce Township
|
Posted: Tue 16 Jul '24 2:00 Post subject: Another question from the tutorial |
|
|
Hi James,
I hope all has been well since I last posted here!
On the section of the the tutorial where you download PHP and edit the php.ini-production file and make all the edits:
I downloaded the thread-safe version from the link provided, extracted to a folder i made called "C:\php8", and followed the steps from the tutorial.
When I finished, I saved it as "php.ini", and when I tried the step: "Ensure you can run PHP from the Windows Command Line (
Code:
php -m
should work and produce a list of modules loaded)."
This did not work for me. My command prompt gave me this message: "'php' is not recognized as an internal or external command, operable program or batch file."
Could you help me figure out where I went wrong? The other steps worked for me up to this point. |
|
Back to top |
|
James Blond Moderator
![](images/avatars/3066243e8d00d4770e.gif)
Joined: 19 Jan 2006 Posts: 7342 Location: Germany, Next to Hamburg
|
Posted: Tue 16 Jul '24 8:41 Post subject: Re: Another question from the tutorial |
|
|
j0511 wrote: | oaded)."
This did not work for me. My command prompt gave me this message: "'php' is not recognized as an internal or external command, operable program or batch file."
|
PHP is not in your PATH variable. You should add it.
But you can still open cmd.exe cd to C:\php8 and run there |
|
Back to top |
|
j0511
Joined: 11 Jun 2024 Posts: 7 Location: Commerce Township
|
Posted: Tue 16 Jul '24 18:59 Post subject: |
|
|
Thanks! I was able to get that step working.
On the next part, where you say, "Finally, this should be the last step, edit the Apache CONF file (httpd.conf) with
make sure you load mod fcgid. (mod_fcgid is an additional download)"
I am unfamiliar with what this means. What is mod fcgid?
Do I need to download the Apache mod_fcgid FastCGI module from the link on apache? (https://httpd.apache.org/download.cgi)
I downloaded the gzip, but where should I extract it to? |
|
Back to top |
|
James Blond Moderator
![](images/avatars/3066243e8d00d4770e.gif)
Joined: 19 Jan 2006 Posts: 7342 Location: Germany, Next to Hamburg
|
|
Back to top |
|