-->![Php Php](/uploads/1/2/6/8/126881934/795700797.png)
![Install Mysql Module Php Windows Install Mysql Module Php Windows](https://www.alphansotech.com/wp-content/uploads/2015/12/Getting-Ready-1.jpg)
by Tali Smith
How install Apache 2.4 PHP 7.1 and MySQL 5.7.18 on Installing WMF 5 and PowerShell 5 on Windows 2008 R2 Using HyperBox to Manage Your VirtualBox 5.0 Servers. Also if php is running as a module within apache you will need to restart the apache server to pickup the changes. Wise to do this in anycase if you're not sure. A 'php -m' from the cmd prompt will show you the modules that are loaded from the ini file. So basically this is a rewrite of my previous guide but with a more proper method and beside you can find all the information you need on installing Apache, MySQL and PHP on a single page without going to another page unless you’re running Windows Vista / 7 of course.
- These are instructions for installing on Windows 7 desktop (they may also be useful for a server install with some thought to security) using individual components rather than a one click installer.
- 1)How to install Apache. 2)Setup PHP for Apache. 3)Install & Configure MySQL to use with PHP. 4)Setup XDebug for Debugging. Note:In this tutorial my Server Folder is located on F: Server. How to install Apache. 1)There are two ways to install apache either install the old version of apache httpd (Compatible with Windows XP) from httpd.apache.org/download.cgi or get the latest.
The fastest and easiest way to install PHP on Internet Information Services (IIS) is by using the Microsoft® Web Platform Installer (Web PI). Web PI completely automates setting up IIS, FastCGI, and the latest version of PHP from the php.net Web site. With Web PI, you can navigate to the 'Web Platform' tab and select 'PHP' under 'Framework and Runtimes' customize link. Alternately, use the instructions that follow as guidance for installing PHP with Windows® Installer or using a compressed (Zip) file installation.
There are two builds for each PHP version: one is thread-safe, and one is not (referred to as the non-thread-safe [NTS] version). The thread-safe version is designed for environments where the Web server core can keep the PHP engine in memory, running multiple treads of execution for different Web requests simultaneously. The architecture of IIS and the FastCGI extension provide an isolation model that keeps requests separate, removing the need for a thread-safe version. The NTS version does not have any of the code that allows PHP to manage multiple threads. As a result, there is a performance improvement on IIS when using the NTS version when compared to the tread-safe version because the NTS version avoids unnecessary thread-safety checks (FastCGI ensures a single-threaded execution environment).
Install PHP
There are two main ways to install PHP on a Windows®-based computer: download the Windows Installer or use the Windows Zip file from the PHP Web site. Either method will get PHP working, but both have some extra steps that are needed to make PHP work well.
Windows Installer
The Windows Installer version can get a complete PHP environment up and running, but the installation of extensions can be confusing. By default, no extensions are installed, and this can adversely affect the usefulness of the PHP installation. Alternately, all of the extensions can be installed; this results in an unstable system because some of the extensions can conflict with others. It is generally easier to use the Zip file installation.
Zip File Installation
To use the Zip file installation, follow the instructions in Using FastCGI to Host PHP Applications on IIS 7.0 and Above. The Zip file installation installs many of the extensions that are available for the Windows Installer version; however, none of the extensions are enabled until their entries in the Php.ini file are set up.
- Download the latest non-thread-safe Zip file package with binaries of PHP. Under Windows Binaries, click on the most current PHP non-thread-safe Zip package to download the PHP files.
- Unpack the files to a directory of your choice (for example,
C:PHP
) on your IIS server. - Rename the Php.ini-recommended to php.ini.
- Open the Php.ini file in a text editor, then uncomment and modify settings as follows:
- Set fastcgi.impersonate = 1.
FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under. - Set cgi.fix_pathinfo = 0
The cgi.fix_pathinfo provides PATH_INFO/PATH_TRANSLATED support for Common Gateway Interface (CGI). Setting this to 1 will cause PHP CGI to fix its paths to conform to the specification. - Set cgi.force_redirect = 0.
- Set open_basedir to point to a folder or network path where the content of the Web site(s) is located.
- Set extension_dir to point to a location where PHP extensions reside. For PHP 5.2.X, this is typically extension_dir = './ext'.
- Set error_log='C:php_errors.log'
This can help with troubleshooting. - Enable the required PHP extension by un-commenting corresponding lines. More information follows in the section, Extensions.
Figure 1 Windows extensions
- Set fastcgi.impersonate = 1.
- Click on Start, Settings, Control Panel, and then double-click on the System icon (using the class view).
- Click on the Advanced system settings link in the left column.
- From the System Properties window, click on the Advanced tab, and then click on the Environment Variables button at the bottom.
- Select the Path variable from the System Variables section, and then click on Edit. Add:
c:php
to your system path.
Figure 2: Edit System Variable - Click OK until you have exited the System Properties window.
- Start IIS Manager by clicking on Start, Programs, Administrative Tools, and then Internet Information Services (IIS) Manager.
- From the IIS Manager, click on the hostname of your server in the Connections panel on the left.
- Double-click on the Handler Mappings icon.
Figure 3: Internet Information Services (IIS) Manager - From the Handler MappingsActions panel, click on Add Module Mapping.
Figure 4: Handler Mappings - Type the following information into the appropriate text boxes, and then click OK.
- Request path: *.php
- Module : FastCGImodule
- Executable: C:phpphp-cgi.exe
- Name: FastCGI
Figure 5: Add Script Map - Click OK, and then c lick Yes.
- In the left panel, click on your server's hostname, and then double-click on the Default Document icon.
- From the Actions panel on the right, click Add.
- Enter index.php as the new default document name, and then click OK.
- Enter default.php as the new default document name, and then click OK.
- In the left panel, click on your server's hostname.
- In the Actions panel on the right, click Restart.
- Create a new text document, and save it as
c:inetpubwwwrootphpinfo.php
with the following content: - You should now see the PHP information page at
http://localhost/phpinfo.php
.
Figure 6: PHP information page
Extensions
It is important to determine which extensions are needed by the applications that will be running and then to limit the installed extensions to only those. For a typical open-source application installation, for example, the following extensions are installed:
- Database Extensions — Most open-source applications that use MySQL for a database engine use either the php_mysql or the php_mysqli extensions. For new development work, either of these extensions work well, or consider using the PDO versions of the MySQL driver (PDO is a PHP extension providing aUsing FastCGI to Host PHP Applications on IIS 7.0 and Above' by Ruslan Yakushev, published on December 5, 2007.
See also
- PHP on Windows Training Kit.
- Installing PHP on Windows Server 2008.
- PHP on IIS7.
- Deploying IIS 7.5 + FASTCGI + PHP on Server Core.
[+/-]
- 2.3.1 MySQL Installation Layout on Microsoft Windows
- 2.3.2 Choosing an Installation Package
- 2.3.3 MySQL Installer for Windows
- 2.3.4 Installing MySQL on Microsoft Windows Using a
noinstall
ZIP Archive - 2.3.5 Troubleshooting a Microsoft Windows MySQL Server Installation
- 2.3.6 Windows Postinstallation Procedures
- 2.3.7 Windows Platform Restrictions
![Php Php](/uploads/1/2/6/8/126881934/795700797.png)
MySQL Community 5.7 Server requires the Microsoft Visual C++ 2013 Redistributable Package to run on Windows platforms. Users should make sure the package has been installed on the system before installing the server. The package is available at the Microsoft Download Center.
MySQL is available for Microsoft Windows, for both 32-bit and 64-bit versions. For supported Windows platform information, see https://www.mysql.com/support/supportedplatforms/database.html.
If your operating system is Windows 2008 R2 or Windows 7 and you do not have Service Pack 1 (SP1) installed, MySQL 5.7 will regularly restart and in the MySQL server error log file you will see this message:
This error message occurs because you are also using a CPU that does not support the VPSRLQ instruction and indicates that the CPU instruction that was attempted is not supported.
To fix this error, you must install SP1. This adds the required operating system support for the CPU capability detection and disables that support when the CPU does not have the required instructions.
Alternatively, install an older version of MySQL, such as 5.6.
There are different methods to install MySQL on Microsoft Windows.
MySQL Installer Method
The simplest and recommended method is to download MySQL Installer (for Windows) and let it install and configure all of the MySQL products on your system. Here is how:
- Download MySQL Installer from https://dev.mysql.com/downloads/installer/ and execute it.Unlike the standard MySQL Installer, the smaller 'web-community' version does not bundle any MySQL applications but it will download the MySQL products you choose to install.
- Choose the appropriate Setup Type for your system. Typically you will choose Developer Default to install MySQL server and other MySQL tools related to MySQL development, helpful tools like MySQL Workbench. Or, choose the Custom setup type to manually select your desired MySQL products.Multiple versions of MySQL server can exist on a single system. You can choose one or multiple versions.
- Complete the installation process by following the instructions. This will install several MySQL products and start the MySQL server.
MySQL is now installed. If you configured MySQL as a service, then Windows will automatically start MySQL server every time you restart your system.
You probably also installed other helpful MySQL products like MySQL Workbench and MySQL Notifier on your system. Consider loading Chapter 30, MySQL Workbench to check your new MySQL server connection, and MySQL Notifier Overview to view the connection's status. By default, these two programs automatically start after installing MySQL.
![Install Mysql Module Php Windows Install Mysql Module Php Windows](https://www.alphansotech.com/wp-content/uploads/2015/12/Getting-Ready-1.jpg)
This process also installs the MySQL Installer application on your system, and later you can use MySQL Installer to upgrade or reconfigure your MySQL products.
Additional Installation Information
It is possible to run MySQL as a standard application or as a Windows service. By using a service, you can monitor and control the operation of the server through the standard Windows service management tools. For more information, see Section 2.3.4.8, “Starting MySQL as a Windows Service”.
Generally, you should install MySQL on Windows using an account that has administrator rights. Otherwise, you may encounter problems with certain operations such as editing the
PATH
environment variable or accessing the Service Control Manager. When installed, MySQL does not need to be executed using a user with Administrator privileges. For a list of limitations on the use of MySQL on the Windows platform, see Section 2.3.7, “Windows Platform Restrictions”.
In addition to the MySQL Server package, you may need or want additional components to use MySQL with your application or development environment. These include, but are not limited to:
- To connect to the MySQL server using ODBC, you must have a Connector/ODBC driver. For more information, including installation and configuration instructions, see MySQL Connector/ODBC Developer Guide.MySQL Installer will install and configure Connector/ODBC for you.
- To use MySQL server with .NET applications, you must have the Connector/NET driver. For more information, including installation and configuration instructions, see MySQL Connector/NET Developer Guide.MySQL Installer will install and configure MySQL Connector/NET for you.
MySQL distributions for Windows can be downloaded from https://dev.mysql.com/downloads/. See Section 2.1.2, “How to Get MySQL”.
Install Mysql Extension Php Windows
MySQL for Windows is available in several distribution formats, detailed here. Generally speaking, you should use MySQL Installer. It contains more features and MySQL products than the older MSI, is simpler to use than the compressed file, and you need no additional tools to get MySQL up and running. MySQL Installer automatically installs MySQL Server and additional MySQL products, creates an options file, starts the server, and enables you to create default user accounts. For more information on choosing a package, see Section 2.3.2, “Choosing an Installation Package”.
- A MySQL Installer distribution includes MySQL Server and additional MySQL products including MySQL Workbench, MySQL Notifier, and MySQL for Excel. MySQL Installer can also be used to upgrade these products in the future.For instructions on installing MySQL using MySQL Installer, see Section 2.3.3, “MySQL Installer for Windows”.
- The standard binary distribution (packaged as a compressed file) contains all of the necessary files that you unpack into your chosen location. This package contains all of the files in the full Windows MSI Installer package, but does not include an installation program.For instructions on installing MySQL using the compressed file, see Section 2.3.4, “Installing MySQL on Microsoft Windows Using a
noinstall
ZIP Archive”. - The source distribution format contains all the code and support files for building the executables using the Visual Studio compiler system.For instructions on building MySQL from source on Windows, see Section 2.9, “Installing MySQL from Source”.
MySQL on Windows Considerations
Php Mysql Windows
- Large Table SupportIf you need tables with a size larger than 4 GB, install MySQL on an NTFS or newer file system. Do not forget to use
MAX_ROWS
andAVG_ROW_LENGTH
when you create tables. See Section 13.1.18, “CREATE TABLE Syntax”.InnoDB tablespace files cannot exceed 4 GB on Windows 32-bit systems. - MySQL and Virus Checking SoftwareVirus-scanning software such as Norton/Symantec Anti-Virus on directories containing MySQL data and temporary tables can cause issues, both in terms of the performance of MySQL and the virus-scanning software misidentifying the contents of the files as containing spam. This is due to the fingerprinting mechanism used by the virus-scanning software, and the way in which MySQL rapidly updates different files, which may be identified as a potential security risk.After installing MySQL Server, it is recommended that you disable virus scanning on the main directory (
datadir
) used to store your MySQL table data. There is usually a system built into the virus-scanning software to enable specific directories to be ignored.In addition, by default, MySQL creates temporary files in the standard Windows temporary directory. To prevent the temporary files also being scanned, configure a separate temporary directory for MySQL temporary files and add this directory to the virus scanning exclusion list. To do this, add a configuration option for thetmpdir
parameter to yourmy.ini
configuration file. For more information, see Section 2.3.4.2, “Creating an Option File”. - Running MySQL on a 4K Sector Hard DriveRunning the MySQL server on a 4K sector hard drive on Windows is not supported with
innodb_flush_method=async_unbuffered
, which is the default setting. The workaround is to useinnodb_flush_method=normal
.