- Mysql Windows
- Php Windows Apache
- Running Mysql On Windows 10
- How To Install Mysql On Windows
- Installing Mysql Module Php Windows 10
by Ruslan Yakushev
I tried to manually install latest version of Apache,PHP7 with MariaDB on a Windows 10 machine, and when i try to run latest phpmyadmin setup script, it return: Fatal error: Uncaught Error: Call to. How to install PHP to run as Apache Module on Windows 10. Install MySQL on Windows 10; How to install PHP to run as Apache Module on Windows 10 - How to Install. It should get you up and running with a Apache/PHP/MySQL install in no time. You could even compare the WampServer config files with your own to see where you originally went wrong. Share| improve this answer.
Introduction
While Microsoft® SQL Server® 2008 is the recommended database to use when hosting PHP applications on an Internet Information Services 7 (IIS 7) and above Web server, you can also use MySQL as the database. Currently, many popular PHP applications use MySQL Server for data storage. Using MySQL requires hosting providers to include MySQL database support with the hosting packages.
MySQL cannot currently be installed with the Microsoft® Web Platform Installer (Web PI). This article provides guidance for installing MySQL manually.
Install MySQL Server on Windows Server 2008 or Windows Server 2008 R2
It is recommended that you install MySQL on a dedicated server rather than installing MySQL on the same server that is running IIS. The separation of database server and Web server makes overall installation more secure and manageable and avoids resource contentions between the database and Web server processes.
- Download MySQL Community Server. We recommend downloading Windows® Installer.
- Start Windows Installer, or extract all the files from the archive, and then start Setup.exe.
- You can use a Typical Setup or customize the installation to suit your needs.
- Once the installation wizard is completed, it is recommended that you leave the Configure the MySQL Server now check box selected.
Configure a MySQL Instance
Run the MySQL Server Instance Configuration Wizard, and then choose the configurations options that most closely match your environment.
For more information, see the Server Instance Configuration Wizard.
Best practice recommendations are as follows:- Click Next in the Instance Configuration Wizard.
- Select Detailed Configuration, and then click Next.
- Select a server type that best suits your environment. It is recommended to set up a separate MySQL server; when prompted to select a server type, select Dedicated MySQL Server Machine, and then click Next.
Select a database option, and then click Next.
- Select either the Multifunctional Database or Transactional Database Only options if you are using the InnoDB storage engine or the high-speed MyISAM storage engine (for example, if the Web applications on your server require multi-statement transactions, advanced isolation levels and row-level locking, foreign key constraints, or atomic, consistent, isolated, and durable [ACID] features). These options provides fully ACID transactional capabilities, but at the cost of more aggressive usage of disk space and memory.
- Otherwise, use the Non-Transactional Database Only option, which is optimized for high-performance SELECT operations. It has low overhead, in terms of memory usage and disk utilization, but at the cost of not supporting transactions.
Choose the option that sets the number of concurrent connections you need.
Note
Connections require memory; if the number you choose is too big, your server may not have enough memory.
- You may adjust networking settings to suit your environment or accept defaults, and then click Next.
- Select the default character set that best suits you, and then click Next.
- We recommend enabling both Windows options here. Select both check boxes, and then click Next.
- Type the password you want to use for the root account, and then click Next.
- Click Execute to apply your settings.
- Click Finish to close the wizard.
For PHP to work with MySQL, it is necessary to perform the following modifications to the Php.ini file:
- Confirm that the extension_dir points to the folder where all PHP loadable extensions are located, frequently in the Ext folder (for example, extension_dir='.ext').
- Enable dynamic extension for MySQL by uncommenting the corresponding line for the MySQL extension: extension=php_mysql.dll
- c. Save and close the Php.ini file.
Secure MySQL
- Remove the anonymous database account (if it exists). Open the MySQL command prompt by clicking Start -> All Programs -> MySQL -> MySQL Server 5.1 -> MySQL Command Line Client:
- Enter the password for the root account.
Once logged on to MySQL, use the following sequence of commands:
Next, restrict the root account to log on only from localhost. Open a MySQL command prompt, and use the following sequence of commands:
Change the name of the root user with the following sequence of commands from the command prompt:
Provision the User and Database
To provision a new user, type the following command from the MySQL command prompt:
The newly created user does not have any privileges on the MySQL server by default. To create a new database, type the following command:
To grant access to this database for a particular user, type the following command:
Configure PHP to Access MySQL
- Open the
c:phpphp.ini
file with your favorite text editor. Uncomment the following lines by removing the semicolon:
- Restart the IIS service by clicking on Start, selecting the Search Field, typing iisreset, and then pressing ENTER.
If all went well, you should see the mysqli section on the PHP information page created earlier
http://localhost/phpinfo.php
.Figure 1: The mysqli section on the PHP information page
Best Practices for MySQL
- Enable TCP/IP Networking — This is the default. Keep the TCP port that MySQL uses to listen at 3306. If the database will be running on a separate system from the Web server, select the Add firewall exception for this port check box.
- Include Bin Directory in Windows PATH — This makes the MySQL utilities available from the command prompt or from Windows PowerShell™.
- Create an Anonymous Account — The default is to keep this disabled. Adding anonymous user support may create a security risk for the database; additionally, enabling anonymous users causes the GRANT statements used to set up database to be unreliable.
See also
Aug 18, 2015How install Apache 2.4 PHP 5.6 and MySQL 5.6.26 on Windows 10
Windows 10 has been released on the world and so an updated how to guide for installing Apache, PHP and MySQL on the latest release. In this post like previous we will cover installing all the programs individually. This will cover installing 64 bit versions of the programs.
Apache 2.4 Install
First download Apache 2.4 from http://www.apachelounge.com/download/ (httpd-2.4.16-win32.zip) Apache 2.4.16 VC11
This release is supported by the PHP 5.6 install from windows.php.net for Apache 2.4.
Extract the zip and copy it to the root of C:. This will be C:Apache24 when it is all done.
Microsoft Visual C++ 2012 Runtime
Download and install Microsoft Visual C++ VS 2012 x86 from https://support.microsoft.com/en-us/kb/2977003 this is required for Apache to run.
PHP 5.6.12 and higher
Download php-5.6.12-Win32-VC11-x86 from http://windows.php.net/download/ . Extract and rename folder to php and move to C:.
Edit Apache’s config file, c:Apache24confhttpd.conf and add the following lines to the bottom of the file.
2 4 | AddHandler application/x-httpd-php.php PHPIniDir'C:/php' |
While we are at it we can add index.php to Apache’s list just incase we want to have a starting page as php.
Find Directory index and add index.php
2 4 6 8 | ;Directory inwhich the loadable extensions(modules)reside. ;extension_dir='./' extension_dir='ext' Uncomment mysql modules extension=php_mysqli.dll |
Save the changes and open a command prompt. Check to make sure it shows loaded modules.
So now we have Apache running and configured to use php. Lets create a file called info.php, save it and see if Apache parses the info correctly to display the results.
Open Notepad or your favorite Windows editor and type and save the following.
2 | phpinfo(); |
Mysql Windows
Open your browser and type, localhost/info.php for the location and you should receive alot of information about PHP.
MySQL
Download and install mysql-installer-community-5.6.26.0.msi. Change installation directory to C:MySQLMySQL Server 5.6 instead of Program files as there could be permissions issues. Once the installation is completed you can let the configuration wizard run and setup the database server. The defaults will work just fine, but remember what you set the password to for root.
Php Windows Apache
At this point you should have a working Apache / PHP / MySQL installation running and ready for you to use!
Running Mysql On Windows 10
Related Posts
How To Install Mysql On Windows
it says php not recognised as any internal or external command, operable program or batch file.
Did you ever find a solution? I am experiencing the same error.
Check your work. I followed his instructions after days of trying to follow other’s, and finally got it to work. Never had a problem with Apache 2.2 on Windows XP (or even Windows 10), but installing Apache 2.4 is different for some reason. Go figure. But it’s now working!
Nice article, thanks, it worked for me. I’ve used php 7, apache 2.4 vc14 and Microsoft visual C++ 2015 update 1. I enjoy a clean installation, no need of WAMP, LAMP…
Kindly Share the versions you have installed…
Which version of php 7 preferably share the link to download
Hi,
Thanks for these instructions, I am very new to anything to do with php or Mysql. I am trying to buid a database on my own computer (not for publishing on the web) and I am assuming I still need to install everything as per instructions. I managed to get apache up and running but get an error message when testing php.the error message is
c:> php -m
php is not recognized as an internal or external command, operable program or batch file.Can you give any advice on what might be causing the problem please? I think it might be to do with your instruction about editting the php.ini file. I found the code
;Directory in which the loadable extension (modules) reside …..
And inserted the code
Uncomment mysql modules ….
immediately after
extension_dir =”ext”
But I am not sure if this is where it was meant to be inserted (the only bit of instruction I couldn’t follow).
Any help would be greatly appreciated,
Many thanks,
RobI have followed all the steps but in the end in “localhost/info.php” the page cant be found. my info.php y saved in httdocs
I had the same error. How did you fix this error?
Thanks
I had this problem too. One more reboot fixed the problem for me
I need some help with two things,
First what do I do with this part exactly? “Next we need to input a value for ServerName variable.” Do I change this line to something or simply leave it uncommented?ServerName http://www.example.com:80
Also the part with the envrionment variables I do not think I am doing right.
I can add:
C:php
C:apache24
C:apache24binall separately in Path for Environment Variables but I cannot add
;c:php;c:apache24;c:apache24bin;”
How am I supposed to correctly edit the variables?
Actually I believe I did the environment variable part right but still don’t know what to do for servername.
Also when I type c:Apache24binhttpd -S into the command prompt it says
“httpd: Syntax error on line 72 of C:/Apache24/conf/httpd.conf: Cannot load modules/mod_access_compat.so into server: The specified module could not be found.”
And whether I comment line 72 or not it will say that.
Hi,
Everything seems to be going great but when I installed apache and tested it, I get an error with the php setting in the config file that we added. Cannot Load C:/php/php5apache2_4.dll into server: %1 is not a valid Win32 application.
I followed all the steps, what can be amiss? Thanks!
Same problem here. The error is reported right during the installation of the Apache server “errors reported here ust be corrected before the service can be started. httpd: Syntax error on line 525 of C:/Apache24/conf/httpd.conf Cannot load c:/php/php5apache2_4.dll into server: %1 nx92 is not a valid Win32 application”
Also followed all the steps and encounter this problem when installing the Apache server under Windows 10.
And there I fixed it…
If anyone get this error, it means that the installed versions of Apache and PHP are not the same (e.g. Apache 64bit and PHP 32bit).
To fix the problem, I had to install the 64bit version of PHP (not the 86x version stated in the instructions), which means basically just downloading the right version, extract all files and replace the existing php folder with the folder containing the extracted files, renamed as “php”.
Now everything works. Thanks for this great post!
Simple and nice instructions. anyone having a little knowledge about technicality of computer can understand this. Worked for me! Thanks.
Is this compatible to Window 7? Thank you.
I had configured following your steps but when i try to start apache an pop up says : The request operation has failed!
i don’t know what to do ;s
i have win 10 pro x64I’m stuck at the same place. I’ve commented out those added lines in httpd.conf and the Apache server starts. The php server works fine. But when those lines are added back in and the Apache server restarted, it doesn’t start up.
Any ideas, newlife007?
You can entirely eliminate the need to manually configure Apache for PHP if you are using a managed hosting platform, like Cloudways (https://www.cloudways.com/en/php-cloud-hosting.php ). Their platform already has Apache, MySQL, Nginx, Memcached and Varnish configured.
I am having the exact same problem that Miguel reported on March 22. when I type localhost/info.php my browser says “cannot reach this page. I didn’t see a reply with an answer to his problem which will probably solve mine too. My Apache server seems to startup and run properly because there were no errors reported. My path has been changed per the instructions and info.php was saved into the c:apache24htdocs directory.
Not seen this mentioned, but have used this before, very easy to install and configure Apache and MySql with PHP install
Was hoping to find steps for setting up LAMP in bash on the new WSL. Particularly how to actually hit the server once it’s running. Maybe a future how-to?
Unrelated: how many geeks do you administer? 😉
I had the same problem, however I download php from http://windows.php.net/downloads/releases/php-7.0.12-nts-Win32-VC14-x86.zip and it works
.. And for php 5. I had downloaded php from http://windows.php.net/downloads/releases/php-5.6.27-nts-Win32-VC11-x86.zip and it works too.
Best regards
My Error to localhost/info.php:
Installed Apache 2.4.23 webserver on windows 10.
64 bit AMD machine.
it was successful.Then installed PHP 7.1.13 Win32 VC14 x64
from the above steps
everything worked tillphp -m
ERROR:
when tried to run
localhost/info.phpgot an HTTP ERROR 404
SOLUTION (in my case):
As I have Skype and it uses port *80I set the PORT in APACHE config file to *8888
Hence to access the info.php in browser type
localhost:8888/info.php
localhost:/info.phpIf you copy and paste changes to the httpd.conf from the screen
(LoadModule php5_module “c:/phpphp5apache2_4.dll”
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir “C:/php”)
, compare the existing quotes used in httpd.conf to what you pasted in. There is a difference between fancy quotes and regular quotes. Apache wont run if there are fancy quotes in the httpd.conf file.i have followed the whole mentioned steps the same, and there is no error, but still localhost page can not be found through the browser.
Hi Save your info.php file in to C:Apache24htdocs
Just wanted to say thanks!
Everything worked perfectly – you the man!Just thought i would add some thing to this nice tutorial……Some time in win 7 and win 10 in the Apache httpd you need to make this path the full. extension_dir = “ext” change to “C:php/ext” or in my case extension_dir = “C:php7/ext”
Hope this helps a few
exscuse me i ment in the PHP.ini my bad
Thanks for this article, working perfectly.
Thanks
Apparently several others have had the same problem. I have installed Apache24, PHP7 and MySQL (64-bit versions) in Windows 10 exactly per the instructions provided.
When DocumentRoot in httpd.conf is configured as C:apache24htdocs” info.php shows up perfectly. When DocumentRoot in httpd.conf is changed to another directory where all the website files exist, only the html files show up (for example, index.html for the website). However, info.php produces a blank screen. There is no error message, only a blank screen. (Note: Yes, I have a copy of the info.php file in DocumentRoot directory.)
Have spent “hours” on this. Any help will be appreciated. Thanks.
Have downloaded httpd-2.4.27-Win64-VC15 and php-7.1.9=nts-Win32-VC14-x64.
following your instructions
edit apache conf file with
LoadModule php5_module “c:/php/php5apache2_4.dll”
or
LoadModule php7_module “c:/php/php7apache2_4.dll”AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir “C:/php”
There is no file named php5apache2_4.dll in php5 download or php7apache2_4.dll in php7 downloadApache says cant locate module.
Hi,
I’m almost done with this setup. Thank you for this article with detailed steps.
I’ve installed Apache 2.4 server, PHP 5.6 and MySQL 5.5
I’m able to run the index.html file as localhost/index.html
I’m also able to run the PHP program through command prompt successfully.
But, when I try to execute the index.php file, I could see the code is displayed as a plain text instead of executing the PHP code.Could you please help.
Thank you in advance!!gracias sirvió y mucho
Trackbacks/Pingbacks
- QGIS Server on Windows 10 – level2 - […] instructions on this post – http://lifeofageekadmin.com/how-install-apache-2-4-php-5-6-and-mysql-5-6-26-on-windows-10/ (install 64bit versions in both cases, you can skip MySQL […]
Installing Mysql Module Php Windows 10
This site uses Akismet to reduce spam. Learn how your comment data is processed.