Setup Mysql As Usual
Setup Mysql As Usual
1. download Apache:
Go to the Apache Lounge website and download the latest version of Apache HTTP
Server.
2. Extract Apache:
Extract the downloaded ZIP file to a directory of your choice (e.g., C:\Apache24).
3. Configure Apache:
Open the C:\Apache24\conf\httpd.conf file in a text editor.
Find the ServerRoot directive and set it to the directory where you extracted Apache,
e.g., ServerRoot "C:/Apache24".
Find the DocumentRoot directive and set it to your desired web directory, e.g.,
DocumentRoot "C:/Apache24/htdocs".
Adjust the Directory directive to match the DocumentRoot
<Directory "C:/Apache24/htdocs">
...
</Directory>
httpd.exe -k install
Start Apache:
You can start Apache by using the Command Prompt
httpd.exe -k start
1. Open the Apache Configuration File:
SETUP MYSQL, APACHE, AND PHP.
Locate the httpd.conf file in the Apache conf directory (e.g., C:\Apache24\conf\
httpd.conf).
Open the httpd.conf file in a text editor such as Notepad.
2. Set the ServerName Directive:
Search for the ServerName directive in the httpd.conf file. It might be commented out
by default.
If the directive is commented out (preceded by a #), uncomment it by removing the #.
Set the ServerName directive to localhost or to your server’s domain name if you have
one. For example:
ServerName localhost
1.
If the ServerName directive does not exist, you can add it anywhere in the httpd.conf
file. A good place to add it is near the top, just below the ServerRoot directive.
2. Save the Configuration File:
Save the changes to the httpd.conf file and close the text editor.
3. Restart Apache:
Open a Command Prompt with Administrator privileges.
Navigate to the Apache bin directory (e.g., C:\Apache24\bin) and run the following
command:
httpd.exe -k restart
1. Download PHP:
Go to the PHP for Windows website and download the latest thread-safe version of PHP.
1. Extract PHP:
Extract the downloaded ZIP file to a directory of your choice, such as C:\
php.
SETUP MYSQL, APACHE, AND PHP.
Open the Apache configuration file httpd.conf located in the conf directory
of your Apache installation, e.g., C:\Apache24\conf\httpd.conf.
Add the following lines to the end of the httpd.conf file to configure PHP
with Apache
# PHP configuration
LoadModule php_module "C:/php/php8apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "C:/php"
extension_dir = "ext"
Enable necessary extensions by uncommenting the corresponding lines (remove the leading ;), for
example:
extension=mysqli
Restart Apache:
Restart the Apache server to apply the changes. You can do this from the Services management
console or by running the following command in the Command Prompt with administrator
privileges:
SETUP MYSQL, APACHE, AND PHP.
httpd.exe -k restart
Log in to MySQL:
mysql -u root -p
USE loginDB;
This creates a simple users table with a hashed password for secure storage.
SETUP MYSQL, APACHE, AND PHP.