Giter VIP home page Giter VIP logo

win-apache-php's Introduction

win-apache-php

This is my local apache server with different php versions.

  • Apache/2.4.58 (Win64)
  • PHP Version 5.3.29
  • PHP Version 5.4.45
  • PHP Version 5.5.38
  • PHP Version 5.6.40
  • PHP Version 7.0.33
  • PHP Version 7.1.33
  • PHP Version 7.2.34
  • PHP Version 7.3.33
  • PHP Version 7.4.33
  • PHP Version 8.0.30
  • PHP Version 8.1.28
  • PHP Version 8.2.18
  • PHP Version 8.3.6 (default)

Installation

You have to define two environment variables for the ServerRoot and DocumentRoot (for example):

WAP_SERVER => D:/win-apache-php  
WAP_DOCUMENT_ROOT => D:/web

Yoy may need to install [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, 2019, and 2022]https://aka.ms/vs/17/release/vc_redist.x64.exe.

Each version of php is used in a virtualhost:

  • virtualhost php53 uses PHP Version 5.3.29
  • virtualhost php54 uses PHP Version 5.4.45
  • virtualhost php55 uses PHP Version 5.5.38
  • virtualhost php56 uses PHP Version 5.6.40
  • virtualhost php70 uses PHP Version 7.0.33
  • virtualhost php71 uses PHP Version 7.1.33
  • virtualhost php72 uses PHP Version 7.2.34
  • virtualhost php73 uses PHP Version 7.3.33
  • virtualhost php74 uses PHP Version 7.4.33
  • virtualhost php80 uses PHP Version 8.0.30
  • virtualhost php81 uses PHP Version 8.1.28
  • virtualhost php82 uses PHP Version 8.2.18
  • virtualhost php83 uses PHP Version 8.3.6
  • All other hosts uses PHP Version 8.3.6

You can add those hosts in the following file c:\Windows\System32\drivers\etc\hosts

127.0.0.1 php53 php54 php55 php56
127.0.0.1 php70 php71 php72 php73 php74
127.0.0.1 php80 php81 php82 php83

Or executing the folling command as administrator

(echo. & echo 127.0.0.1 php53 php54 php55 php56) >> C:\Windows\System32\drivers\etc\hosts
(echo. & echo 127.0.0.1 php70 php71 php72 php73 php74) >> C:\Windows\System32\drivers\etc\hosts
(echo. & echo 127.0.0.1 php80 php81 php82 php83) >> C:\Windows\System32\drivers\etc\hosts

Add folder %WAP_SERVER%\php-8.3-Win32-vs16-x64 to path if you want to execute php or composer from the command line.

Finally, install apache as service (run as administrator)

%WAP_SERVER%\Apache-2.4-win64\bin\httpd.exe -k install

You can install it automatically executing configure.bat as administrator. It will create the folder web next to win-apache-php if does not exists, add PHP to path, set the system variables WAP_SERVER and WAP_DOCUMENT_ROOT, add hosts, install and start apache service.

Once installed and service started, you can test the phpinfo() for each version to check all is working correctly (phpinfo is only accesible from each php host and localhost).

Uptate

To update this repo, you only have to stop apache service and pull. A simple way is executing the following commands as administrator.

cd /d %WAP_SERVER%
sc stop Apache2.4  
git pull  
sc start Apache2.4  

Yoy can also run update.bat as administrator.

Development SSL Support

If you need SSL support for development purposes, just execute certs\install.bat and it will enable HTTPS support for localhost and php71 an above thanks to https://github.com/FiloSottile/mkcert

install.bat will generate rootCA and win-apache-php in certs folder.

Once installed, you can check https://localhost/phpinfo

โš ๏ธ Remember that you should not export or share rootCA-key.pem

win-apache-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

win-apache-php's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.