WYSIWYG md editor SimpleMDE or use some desktop markdown text editor    Home    [ html2markdown ]
Markdown txt 01/001_instalac/001_apache_php/laragon.txt Parsedown-ed to HTML.    [ Edit text ]    [ Colored text ]

WAMP Server for Local WordPress - Laragon


https://forum.laragon.org/category/5/tutorials - Add newer PHP... XDebug, PostgreSQL, Python, ruby, Rails, Golang

Also https://github.com/denoland/deno/ - provide a productive and secure scripting environment for modern programmer. It is built on top of V8, Rust, and TypeScript.




Can Install WordPress using Laragon's "quick create" feature.

Add another PHP version :

  1. https://windows.php.net/downloads/releases/ eg php-7.4.10-nts-Win32-vc15-x64.zip
    or "archives" subfolder (ie https://windows.php.net/downloads/releases/archive )
  2. Extract downloaded to: {LARAGON_ROOT}\bin\php\php-7.4.10-nts-Win32-vc15-x64
  3. Select new version at: Laragon Menu >PHP> Version > php-7.4.0-Win32-vc15-x64

If something's wrong, check and install correspond VC Redist (VC11, VC14, VC15...).

  1. x64 means 64-bit
  2. xx86 means 32-bit
  3. nts means Non Thread Safe - if using Nginx instead of a multi-threaded Apache, use more efficient nts version https://stackoverflow.com/questions/1623914/what-is-thread-safe-or-non-thread-safe-in-php .

Add another Apache version

  1. https://www.apachelounge.com/download/VC14/binaries/ eg httpd-2.4.28-win64-VC14.zip
  2. Extract downloaded to: {LARAGON_ROOT}\bin\apache\httpd-2.4.28-win64-VC14
  3. Select new version at: Laragon Menu > Apache > Version > httpd-2.4.28-win64-VC14

Add another Nginx version - lot of "Bad Gateway" errors

Nginx port change : Menu -> Nginx -> Sites enabled -> 00-default.conf

  1. http://nginx.org/download/ eg nginx-1.19.2.zip
  2. Extract downloaded to: {LARAGON_ROOT}\bin\nginx\nginx-1.19.2
  3. Select the new version at: Laragon Menu > Nginx > Version > nginx-1.19.2

Add another MySQL or MariaDB version

  1. https://dev.mysql.com/get/Downloads/ MySQL-5.7/mysql-5.7.18-winx64.zip
    Extract the downloaded to: {LARAGON_ROOT}\bin\mysql\mysql-5.7.18-winx64

    See below Note for MariaDB
    https://downloads.mariadb.org/mariadb/ eg mariadb-10.5.5-winx64.zip

    Select the new version at: Laragon Menu > MySQL > Version > mysql-5.7.18-winx64

    Note: If you use MariaDB, extract it to: {LARAGON_ROOT}\bin\mysql\mariadb-10.5.5-winx64 Laragon will automatically create correspond DataDir for MariaDB on data/mariadb

Add phpMyAdmin

https://www.phpmyadmin.net/downloads and extract to {LARAGON_DIR}\etc\apps\phpMyAdmin.
SHA256 hash matches

Acess phpMyAdmin at: http://localhost:8083/phpmyadmin

Install PHP's Oracle OCI8 extension (works with both Apache & Nginx)

  1. Download php_oci8-2.2.0-7.4-nts-vc15-x64.zip from https://pecl.php.net/package/oci8/2.2.0/windows OCI8 extension to access Oracle DB. Use 'pecl install oci8' to install for PHP 7. I only unzip php_oci8_12c.dll 147456 B, 2019.12.04 in : J:\awww\bin\php\php-7.4.10-nts-Win32-vc15-x64\ext on dev site, or in
    J:\ylaragon\bin\php\php-7.4.10-nts-Win32-vc15-x64\ext on test site.

    Or (not working) Download Oracle Instant Client Zip file:
    http://www.oracle.com/technetwork/topics/winx64soft-089540.html Note: You must accept "Accept License Agreement" and "create an account (Free)"

  2. ? Extract all dll in downloaded zip file to PHP dir (Menu > PHP > Version > dir:php-xxx-xxx)

  3. Enable: click Menu > PHP > Extensions > php_oci8_12c.dll

  4. Restart Apache. You should see Oracle OCI information on phpinfo().

Instant Client Installation for Microsoft Windows 64-bit

See the Instant Client Home Page for more information about Instant Client packages. Client-server version interoperability is detailed in Doc ID 207303.1.

For example, Oracle Call Interface 19, 18 and 12.2 can connect to Oracle Database 11.2 or later. Some tools may have other restrictions.

  1. Download the appropriate Instant Client packages for your platform - Basic or Basic Light
  2. Unzip packages dir. eg C:\oracle\instantclient_19_3
  3. Add this dir to PATH environment variable. If you have multiple versions of Oracle libraries installed, make sure the new directory occurs first in the path. Restart any terminal windows or otherwise make sure the new PATH is used by your applications.
  4. Download and install correct Visual Studio Redistributable from Microsoft. Instant Client 19 requires the Visual Studio 2017 redistributable. Instant Client 18 and 12.2 require the Visual Studio 2013 redistributable. Instant Client 12.1 requires the Visual Studio 2010 redistributable.
  5. If you intend to co-locate optional Oracle configuration files such as tnsnames.ora, sqlnet.ora, ldap.ora, or oraaccess.xml with Instant Client, then create a subdirectory such as
    This is default Oracle client configuration dir for apps linked with this Instant Client.

    Alternatively, Oracle client configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMIN to that directory name.

  6. Start your application.

ODBC users should follow the ODBC Installation Instructions.

2020.01.16 To get this working with latest Laragon & PHP I had to download instant client version 12 and place DLLs in Laragon root folder (alongside laragon.exe). Placing them in php dir or Apache bin dir did not work.

Virtual host - not convinient for B12phpfw

  1. Menu -> Preferences -> General tab - you can change your projects directory and you can set domain for virtual host name eg: {project_name}.me. By the default host name is http://project_name.dev.

  2. When you create new folder in Document Root folder of laragon, laragon automatically creates virtual host. if you want see the project with virtual host
    click "Menu" button -> select www, now you can see your project with virtual hostname. click hostname to navigate in the browser.

How to enable a manually created virtual host :

create a Virtual Host file without "auto." prefix, Laragon will respect any changes in the file.

Assume you have a project name: dev1 (or myproj) You can create a file name
etc/apache2/sites-enabled/dev1.conf with content like this:

<VirtualHost \*:8083> 
  DocumentRoot "J:/awww/www/"
    ServerName dev1
    ServerAlias \*.dev1.dev
    <Directory "J:/awww/www/">
       AllowOverride All
       Require all granted

Note: You need to put dev1 and dev1.dev entry to your hosts file. The quickest way is let Laragon auto-create Virtual Hosts for you (not convinient for B12phpfw ?), then you just remove the "auto." prefix from the Virtual Host file.

apvh.bat to create AP(ache) V(irtual) H(ost) using command line for Laragon


Change the SSL files directory on line 9 according to yours. i.e. set SSL_PATH=F:/laragon/etc/ssl/ -> set SSL_PATH=Your/Laragon/installation/path/etc/ssl/

Open the Terminal and cd into the directory where all your virtual hosts are stored. (for me: J:\ylaragon\etc\apache2\sites-enabled)

apvh {sitename} {directory} {ssl}

? Where:
sitename: Sitename containing .domain name.
directory: full absolute path to the site directory - must not contain trailing slahes (\ or /).
ssl: Use ssl to have the virtual host for SSL else empty.

?? Remember:
This script assumes that you have added virtual host entry to
file and in alt_names section in the openssl template file (for me: in J:\ylaragon\bin\laragon\tpl\openssl.conf.tpl, not in J:\ylaragon\usr\tpl\openssl.conf.tpl)

?? Acronyms:
apvh === Apache virtual host.
India == Indians never delay in anything.

@echo off

:: Author https://github.com/bantya :: Manually create apache virtual hosts file for Laragon

set SITE_NAME=%1 set SITE_PATH=%2 set WANT_SSL=%3 set SSL_PATH=F:/laragon/etc/ssl/

if "%SITE_PATH:~-1,1%" neq "/" ( set SITE_PATH=%SITE_PATH:\=/%/ )

if "%WANT_SSL%" == "" ( echo. ( echo.^<VirtualHost *:80^> echo. DocumentRoot "%SITE_PATH%" echo. ServerName %SITE_NAME% echo. ServerAlias *.%SITE_NAME% echo. ^<Directory "%SITE_PATH%"^> echo. AllowOverride All echo. Require all granted echo. ^</Directory^> echo.^</VirtualHost^> ) ^> %SITE_NAME%.conf )

if "%WANT_SSL%" == "ssl" ( echo. ( echo.define ROOT "%SITE_PATH%" echo.define SITE "%SITE_NAME%" echo. echo.^<VirtualHost *:80^> echo. DocumentRoot "${ROOT}" echo. ServerName ${SITE} echo. ServerAlias *.${SITE} echo. ^<Directory "${ROOT}"^> echo. AllowOverride All echo. Require all granted echo. ^</Directory^> echo.^</VirtualHost^> echo. echo.^<VirtualHost *:443^> echo. DocumentRoot "${ROOT}" echo. ServerName ${SITE} echo. ServerAlias *.${SITE} echo. ^<Directory "${ROOT}"^> echo. AllowOverride All echo. Require all granted echo. ^</Directory^> echo. echo. SSLEngine on echo. SSLCertificateFile %SSL_PATH%%SITE_NAME%.crt echo. SSLCertificateKeyFile %SSL_PATH%%SITE_NAME%.key echo.^</VirtualHost^> ) ^> %SITE_NAME%.conf )

echo.Your Apache virtual-host file %SITE_NAME%.conf is created. pause start .

nts and nsp>
A Thread Safe version should be used if you want to install PHP as an Apache module where worker is the MPM.br>
For multithreaded webservers, such as IIS5 and IIS6, you should use threaded version of PHP.

IMAP (Win/Unix) Library is not thread safe - not recommended for use in a multi-threaded environment.

mod_php Apache module

Apache MPM prefork with modphp is used because it is easy to configure/install. Performance-wise it is fairly inefficient. Preferred way to do the stack is eg FastCGI/PHP-FPM. That way you can use much faster MPM Worker. The whole PHP remains non-threaded, but Apache serves threaded (like it should).

Apache HTTP web server supports multiple models for handling requests, one of which called worker MPM uses threads. But it supports another concurrency model called prefork MPM uses processes - that is, web server will create/dedicate a single process for each request.

There are multiple ways to chain the web server with PHP. For Apache HTTP Server, the most popular is "mod_php" module - actually PHP itself, but compiled as a module for web server, and so PHP gets loaded right inside it .

Since with mod_php, PHP gets loaded right into Apache, if Apache is going to handle concurrency using its Worker MPM (that is, using Threads) then PHP must be able to operate within this same multi-threaded environment - meaning, PHP has to be thread-safe to be able to play ball correctly with Apache!

At this point, you should be thinking "OK, so if I'm using a multi-threaded web server and I'm going to embed PHP right into it, then I must use the thread-safe version of PHP". And this would be correct thinking. However, as it happens, PHP's thread-safety is highly disputed (diskutabilan). It's a use-if-you-really-really-know-what-you-are-doing ground.

Advice would be to not use PHP in a multi-threaded environment if you have the choice!

Speaking only of Unix-based environments, I'd say that fortunately, you only have to think of this if you are going to use PHP with Apache web server, in which case you are advised to go with the prefork MPM of Apache (which doesn't use threads, and therefore, PHP thread-safety doesn't matter) and all GNU/Linux distributions that I know of will take that decision for you when you are installing Apache + PHP through their package system, without even prompting you for a choice. If you are going to use other webservers such as nginx or lighttpd, you won't have the option to embed PHP into them anyway. You will be looking at using FastCGI or something equal which works in a different model where PHP is totally outside of the server with multiple PHP processes used for answering requests through e.g. FastCGI. For such cases, thread-safety also doesn't matter. To see which version your website is using put a file containing <?php phpinfo(); ?> on your site and look for the Server API entry. This could say something like CGI/FastCGI or Apache 2.0 Handler.

If you also look at command-line version of PHP - thread safety does not matter.

Non thread safe version is faster and/or less buggy, or otherwise they would have just offered thread safe version and not bothered to give us choice!

PHP's interactive console

php -a
Interactive shell

php > $a = 'Hello world!';
php > echo $a;
Hello world!
php >

Interactive shell is not a REPL (Read-Eval-Print Loop) since it lacks the print - seen $a immediately after assigning it.

http://psysh.org/manual/en/php_manual.sqlite for Psysh see https://github.com/bobthecow/psysh/wiki/PHP-manual

C:\Program Files (x86)\Common Files\Oracle\Java\javapath;

J:\xampp\php;  NOT GOOD

C:\Program Files\dotnet\;
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;
C:\Program Files\nodejs\;
C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;
C:\Program Files (x86)\Common Files\Acronis\VirtualFile\;
C:\Program Files (x86)\Common Files\Acronis\VirtualFile64\;
C:\Program Files (x86)\Common Files\Acronis\FileProtector\;
C:\Program Files (x86)\Common Files\Acronis\FileProtector64\;
C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;

composer require psy/psysh:@stable
on Windows J:\awww\www>.\vendor\bin\psysh        on Linux ./vendor/bin/psysh
                    or : 
                    git clone https://github.com/bobthecow/psysh.git
                    cd psysh
                    composer install
                    wget https://psysh.org/psysh
                    chmod +x psysh








For MS Expression web :

<body style="margin: 1em; padding: 30px 10% 50px 10%; 
font-size: 1.2em; font-family: Corbel, Arial, Helvetica, sans-serif ;