How to manually install Apache, PHP and My.SQL on Windows Apache.First, I recommend you read the Platform Specific Notes of Apache for Windows it explains some Windows specific features like running as a service that you dont have on other OSes and you probably have never used before.As mentioned in these platform specific notes, Apache doesnt provide binaries for Windows, however they have links to several third party sites that provide binaries, for example Apache Lounge.From that website, we can download either the 3.Bit version win. Bit one Win.OS is 6. Bit you should always try to install 6.Bit versions of software, but note that youll need to use 6.Bit modules as well, that means if you only have a 3.Bit module then download the 3.Bit Apache. Heres the version that I used when writing this Apache 2.Win. 64 it was the latest version when this answer was last updated look at the edit date at the bottom of the post.Once downloaded, just extract the Apache.C Apache. 24bin. Open a command line window WindowsR and type cmd then press Enter, change directory into C Apache.If you get an error dialog stating that MSVCR1.Apache_Tomcat4.png' alt='Install Apache Php5 Mysql Windows Client' title='Install Apache Php5 Mysql Windows Client' />Visual C Redistributable for Visual Studio 2.Bit systems and vcredistx.Bit ones. If you get an error saying that it cant bind to port 8.Skype is known to use ports 8.Use port 8. 0 and 4.If you decide to change your configure options after installation, youll need to rerun the configure, make, and make install steps.You only need to.Install Apache Php5 Mysql Windows Client' title='Install Apache Php5 Mysql Windows Client' />Skype to apply the changes, and then you should be able to start Apache without issues.A warning like Could not reliably determine the servers fully qualified domain name can be ignored for now.Windows Firewall may prompt you to allow Apache to communicate on specific networks, I recommend you use the default settings allow it on home and work networks, but not on publicuntrusted networks.Then, open a browser and browse to http localhost, if you see a page saying It works Apache installation is working.You can now stop the currently running Apache by pressing CtrlC in the command prompt.If you got a warning about not being able to determine the systems fully qualified domain name, fix it by editing C Apache.Server. Name variable it should be already there in a comment, just uncomment it and change it Server.Install Apache Php5 Mysql Windows Client' title='Install Apache Php5 Mysql Windows Client' />Name lt yourhostname.Replace lt yourhostname with either the systems host name or localhost.Finally, if you want to run the server automatically when the system starts even if nobody logs in, youll need to run it as a service in a new elevated as an administrator command prompt, type httpd.Thats it, now you have a new service in Services WindowsR then type services.Enter named Apache.Windows service. Restricting Apache access to localhost only optional.If youre setting this up for development purposes you want to make sure that no one except you can access it, your firewall should already take care of that but lets add another layer of security to it by telling Apache to accept requests from the local machine only.Open Apaches configuration file C Apache.Directory c Apache.At the end if it, there should be a line Require all granted, this means that anyone can access this server.Lets make that Require local which only allows access from the local machine.Also, you can tell Apache to only bind to the loopback interface, that way even if both your firewall and the access control directives mentioned above fail, the server still wont be open to the whole internet.For this, locate the Listen directive by default its set to 8.Listen 1. 27. 0. 0.Listen 1 8. The first line is self explanatory, the second one is the first ones IPv.IPv. 6 notation to separate the address and the port.Save the file, if youre already running the server then restart it in order to take our changes into account, and now only localhost has access, everyone else will get a 4.Forbidden. PHPI suggest you read the official PHP documentation about installing it on Windows systems.Download the latest PHP binaries from the official PHP for Windows download page, choose the thread safe version that matches your Apache installations bit version x.Bit, x. 64 for 6.Bit. The non thread safe version is only when running as a CGI binary more info here.The version I used is this PHP 5.VC1. 1 x. 64 Thread Safe it was the latest version when this answer was last updated look at the edit date at the bottom of the post.Create an empty PHP folder at the root of your hard drive, and extract the previously downloaded archive there, you should have a path like C PHPext, otherwise you did something wrong.In C PHP, rename the php.Open that php. ini file, search for extensiondir ext and uncomment that line remove the first.This sets the default extension dir to ext which resolves to C PHPext and avoids having to prepend ext to all extensions paths manually like in previous versions of this post.The following is for PHP 5 only.For PHP 7, see Rahul.Now configure Apache to use that PHP, by editing C Apache.Load. Module lines, add the following Load.Module php. 5module C PHPphp.If. Module php. 5module.Directory. Index index.Add. Handler applicationx httpd php.PHPIni. Dir C PHP.If. Module. Now try to start Apache manually by opening a command prompt in C Apache.PHP is most likely working.You can test your PHP installation by creating a file like info.PHP installation and all its modules.If you get something else like an Internal server error that means somethings wrong.You can now kill your current Apache process CtrlC in the console and start the service the following part doesnt interact with Apache and can be done with the server already started.Composer optional.Composer is a tool for dependency management in PHP, like a package manager.It allows to easily install PHP packages and even entire frameworks.Composer requires the PHP Open.SSL extension to be enabled, so lets enable it in C PHPphp.Use your text editors search function to search for phpopenssl.Now download Composers Windows installer from their download page or just use this direct link.Follow the instructions, when prompted for the path to PHP, browse to C PHP and select php.Thats it, Composer is now installed system wide and can be used from anywhere you can try it out, just open a new command prompt you cant use one thats already open since it needs to read the new PATH variable set by Composers installer and type composer.You should get a nice ASCII art logo and something like this Composer version e.PHP My. SQL extensions optional.If you want to access your My.SQL database from PHP, youll need to enable extensions that allow you to do so, like phpmysqli or phppdomysql I recommend enabling them both.Open PHPs configuration file C PHPphp.Done, now you can access any My.SQL database using either mysqli or PDO.My. SQLOn the My.SQL Installer download page download the web installer mysql installer web community xxxxx.I used mysql installer web community 5.The installer will automatically install the appropriate version 3.Bit or 6. 4 Bit depending on your system, even though My.SQLs bit version doesnt have to match Apaches and PHPs one but its still beneficial to use the 6.GB of RAM, thats quite important as database servers tend to use a lot of RAM.Follow the steps in the installer, if youre installing this for development then the Developer default will be your best option, itll also install My. Pageplus Starter Edition Tutorials on this page. SQL Workbench which is a native GUI client, thus avoiding you having to install slow web based tools such as PHPMy.Admin if you arent comfortable with using the command line client.Once everything is installed the installer will ask your for some basic configuration values, I recommend disabling Open firewall port for network access unless you want to access the database from another machine on the network.Set the root password if its only for development purposes and your firewall blocks incoming connections from the network then a strong password isnt necessary.Finally, you can disable the useless My.SQL Notifier by right clicking the tray icon, going into Actions Options, then untick the Run at Windows Startup checkbox and apply.Thatll save you a few MBs of RAM and avoid slowing your machine down when its booting.And thats it, you now have a fully functional WAMP server that runs as a service and doesnt depend on any user accessible even if no one is logged in.PHP Apache 2. x on Unix systems.I have successfully installed Apache 2.PHP 5. 2. 8 under Red Hat 9.Pentium 1. 66 with 3.MB of RAM. While I used RH9, the worst possible case, these notes are probably good for RH based distributions too Red Hat Enterprise, Fedora, Cent.OS. If you want to install My.SQL, it needs to be installed before PHP because PHP requires some libraries be available.One think important when picking up a binary distribution of My.SQL is to download all four packages My.SQL server, My. SQL devel, My.SQL client and My.SQL shared. Note The My.SQL was bundled with PHP 4 but is not anymore in PHP 5.Then you need to install Apache before PHP, because again PHP needs some libraries be available.I installed Apache 2 from source, using the very last version available, which is 2.I installed PHP 5.Here, I had a number of problems, but none which I could not resolve easily, some of them with a little help from different forums I found through Google.Rembember When it says you need a package named xyz and you notice there is also one named xyz devel, grab it.Most of the packages I got from http legacy.Red. HatRPMSA similar page exists for other versions of Red Hatand http rpmfind.This site has an updated version of some of the packages.Make sure to use only the one labeled for you version in my case, Red Hat 9.You already have glibc and glibc common installed, but you need to get glibc devel and glibc kernheaders.Make sure to match glibcs version rpm q glibc.Note When it says kernel header is a required dependency, thats glibc kernheader not kernel source.You will also need binutils no need to match the version, and gcc and cpp version must match.You need zlib devel zlib is probably already installed, match the version you have.If you install the GD extension, the actual library is already bundled with PHP 5 use that one, they have done some changes in there, so dont upgrade, but you will need to install libpng and libpng devel match version, or disable in configure if you dont want and libjpeg no devel with that one.You will also need libxml.Now there were a problem, because PHP requires libxml.Red Hat only supplied 2.RH9 if you have a more recent distro, you might be more lucky.After looking for a while, I decided to grab the source code for the most recent distribution at the official website http xmlsoft.Hope my post is useful to someone.Please, share your experience when compilinginstalling for your particular platform and setup.Remember how hard its been for you the very first time.I confess, my very first server installation took me nearly a week and I was glad others helped me.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |