Wednesday, September 9, 2015

install apache php windows server 2012


rebuild php apache, node

1) Install mysql, 5.7,  it auto install vc++ 2013 vc++2015, so no need manual install for apache later.
      As long as mysql, bench installed , you are good with vc++

1) unzip folder 'apache24' and 'php5' to c:\
2) install apache as service by:  use command line, cd into apache24\bin\
       httpd.exe -k install

3)add to path envrionment variable.
Add
;c:\php5;c:\Apache24; c:\Apache24\bin;

4) run apache24\bin\apache monitor.exe



5) install node, (npm included.)

6)firewall open port 80, 3000

7)copy node folder arcgis_viewer

8) cmd install nodemon

npm install -g nodemon

9)import mysql database.



10)  cd C:\node\arcgis_viewer

nodemon --exec npm start




==============================================================

php7 vc15   + apache 2.4.29 vc15

  1. Download PHP, apache, unzip to c:\apache24   and c:\php7\
  2. Add  c:\apache24\bin,   c:\apache24\  and c:\php7\   to PATH environment variable
  3. Update php.ini,   
  4. Update httpd.conf (Apache config file) to load php7apache2_4.dll module in PHP folder and set PHPIniDir to PHP directory
  5. Copy (libeay32.dll) libssh2.dll and (ssleay32.dll) into apache/bin  [I only find libssh2.dll]
  6. Restart Apache.






curl is not loaded by default, so you have to do below manually:
=========================================================

1)Edit php.ini file Enable( uncomment) php_curl.dll and php_openssl.dll extensions


2)go to c:/php7/

Copy libssh2.dll  into c:/apache24/bin folder. 

3) test by:  curl_test.php

   

    // Script to test if the CURL extension is installed on this server

     // Define function to test
        function _is_curl_installed() {
    if  (in_array  ('curl', get_loaded_extensions())) {
        return true;
    }
    else {
        return false;
    }
    }

    // Ouput text to user based on test
     if (_is_curl_installed()) {
        echo "cURL is installed on this server";
      } else {
      echo "cURL is NOT installed on this server";
    }
    ?>
=================================================================
must have visual c++ installed (visual studio)

1) unzip folder 'apache24' and 'php5' to c:\
2) install apache as service by:  use command line, cd into apache24\bin\
       httpd.exe -k install

3)add to path envrionment variable.
Add
;c:\php5;c:\Apache24; c:\Apache24\bin;

4) run apache24\bin\apache monitor.exe


======================================================================================
Well it is finally time to start playing a bit more with Microsoft’s latestserver OS Windows Server 2012 R2. One of the many things to have on the list is getting the WAMP (Windows/Apache/MySQL/PHP) stack working. So in this post we will get installed and running Apache 2.4.9, MySQL 5.6.19 and PHP 5.5.13 on Windows Server 2012 R2. Also, instead of 32 bit apps we will be install 64 bit.
You will need to download and install  Visual C++ Re-distributable for Visual Studio 2012 fromhttp://www.microsoft.com/en-us/download/details.aspx?id=30679#. You will also need .NET 4.0 installed as a prereq for MySQL and Visual C++ 2010 re-distributablehttp://www.microsoft.com/en-us/download/details.aspx?id=14632.
Download 64 bit Apache (httpd-2.4.9-win64-VC11.zip) from http://www.apachelounge.com/download/. Download and extract the zip and copy it to the root of C:\. This will be C:\Apache24 when it is all done.
Download php-5.5.13-Win32-VC11-x64.zip Thread Safe from http://windows.php.net/download/ . Extract and rename folder to php and move to C:\.
Extract php-5.5.13-Win32-VC11-x64.zip.  Edit Apache’s config file, c:\Apache24\conf\httpd.conf and add the following lines to the bottom of the file.
LoadModule php5_module "c:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
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
DirectoryIndex index.html index.php
Next we need to input a value  for ServerName variable. You will have to un-comment it. Save the changes to the config file. Next move to the Register Apache Service step.
Register Apache Service
Now let’s register Apache as a service. Open a command prompt and type.
c:\apache24\bin\httpd -k install
If do not want Apache starting automatically at start-up/reboot:
GUI Way
  • START | RUN
  • Type in services.msc, hit Enter or click OK
  • Locate Apache2 service and double-click (or right-click for Properties)
  • Find the caption Startup type: (in the middle of the dialog box), use the pull-down and select Manual
  • Click OK
Command line
C:\> sc config Apache2.4 start= demand
Add
;c:\php;c:\Apache24; c:\Apache24\bin;
to PATH in Environment variables. PATH ENVIRONMENT (System Properties | Advanced | Environment Variables | System variables | Path).
Example:
;c:\php;c:\apache24;c:\apache24\bin;
Now lets check Apache settings by issuing the command, c:\Apache24\bin\httpd -S
PHP Edits
Now we have to do a few edits to the php.ini file to tell it to load support for mysql and the location for the extensions. Since there is not a already set php.ini file we need to rename one of the two examples to php.ini.
Rename c:\php\php.ini-development to php.ini
Now let’s edit php.ini
Uncomment extension directory.
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "ext"

Uncomment mysql modules
extension=php_mysql.dll
extension=php_mysqli.dll
Save the changes and open a command prompt. Restart Apache to re-read the changes made to PHP.
Check to make sure it shows loaded modules.
C:\> c:\php\php -m
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.
 
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-5.6.19-win64.msi. Change installation directory to C:\MySQL\MySQL 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.
PHPMyAdmin
PHPMyAdmin is a very nice tool to use for administering your MySQL installation.
Download and install phpmyadmin-3.4.10.1-english.zip.
Extract the file and move to c:\apache24\htdocs. Rename directory to phpmyadmin.
Create a config directory under phpmyadmin. Open a browser and type localhost/phpmyadmin/setup/index.php to complete the installation.
At this point you should have a working Apache / PHP / MySQL installation running and ready for you to start developing !!!

No comments: