11. PHP CMS – XAMP 64 bit on Windows 10, flat files CRud (u, d in Op.Sys – WYSIWYG SimleMDE or Summernote) or relational DB tblrows CRUD

Revised 2020.03.26 Code download : https://github.com/slavkoss/fwphp
I made B12phpfw ver. 6 code skeleton on which are modules Mnu, Blog (Msg), Mkd and many PHP learning examples.

Conclusion for this and my previous 10 posts

Posts are organized as PHP learning book, so I change previous posts periodically !

5W of every activity (highest ideas, categories, eg in journalism…)

who: Web site – menu & CRUD code skeleton applied to 3 modules (wrong to say applications) : “Mnu”, “Blog (Messages, Msg)”, “Mkd” in dirs :

  1. WEBSERVERDOCROOT\fwphp\www (fwphp is group of applications, www is menu appl consisting of one module)
  2. WEBSERVERDOCROOT\fwphp\glomodul\blog (glomodul is “application global modules” = group of global modules, )
  3. WEBSERVERDOCROOT\fwphp\glomodul\mkd

where(is code) : All Sites level Globals, Modules Globals, Menu code skeleton, Config classes, Crud classes.

when: Clear visible programming stepssignal flow, data flow & code flow

what: Basic Menu & CRUD code skeleton for (who)


  1. FUNCTIONAL (DECLARATIVE) NAMING – descriptions of WHAT, NOT HOW STEPS -eg not programming steps M, V, C. Directory named invoice_fmb, means bussiness proces, not how steps (ee not 3 dirs M, V, C for all modules – fmb-s) !
  2. index.php is MAIN MODULE’S SINGLE ENTRY POINT ee all (submenus) calls go through this script. Here is configuration minimized, CONVENTIONS maximized. Same all other modules.
  3. simple OWN DEBUGGING and XDEBUG.
  4. CLASSES FOR: Config, (Controllers), Models (CRUD), not for Views but could be.
  5. namespaces & own autoloading class scripts. Composer’s PSR-4 is problem for not 3 dirs M, V, C for all modules but each module in own dir (huge difference) ?
  6. pagination in Blog pages
  7. beautiful urls without web server url rewritting (see QS=”?” constant.
  8. search/filtering/sort in Blog pages
  9. password_verify and password_hash functions explained (in z_examples)
  10. RTE (Rich Text Edit) markdown (SimpleMDE & Parsedown MD2HTML) or HTML (Summernote)

why: Not found hows above in learning sources : Simplest possible code skeleton, newest PHP coding style, good code explanations – code help.

Main (Root) module contains main index.php

www subdir in fwphp dir contains root module, site’s index.php. Has links on many test-learn examples.

Mkd module is Dreamweaver replacement

Can WYSIWYG edit:

  1. markdown using SimpleMDE or other
  2. or html using Summernote or other.

No relational database CRUD (so code is simpler) but similar, based on same B12phpfw fw (program skeleton) as Msg realational DB tables rows PDO CRUD module, so Mkd is good for learning MVC framework skeleton coding. I think B12phpfw is best-simplest DB PDO CRUD framework (for framework haters which also am I partially: it is not framework, it is standardized basic code skeleton) . Why version 6 ? B12phpfw is good example how small but important changes in fw code cause:

  1. lot of work
  2. and when done much simpler use of basic code skeleton.



1. XAMPP 64 bit, php 7.4.2 https://www.apachefriends.org/download.html (I do not use WAMP SERVER anymore)

If no XAMPP (more work) : PHP (for Windows thread safe) : php 7.4.x needs VC15 or VS16 (Visual Studio 2017 or 2019 compiler respectively) Apache : https://www.apachelounge.com/download/

2. CONFIG SCRIPTS see 00info_php2.php – all config scripts are here

J:\xampp\apache\conf\httpd.conf J:\xampp\apache\conf\extra\httpd-vhosts.conf C:\Windows\System32\drivers\etc\hosts J:\xampp\php\php.ini

3. CONNECT PHP 7.2.4 TO OracleXE 11.2


php_pdo_oci.dll comes with XAMPP.

In php.ini extension=pdo_oci and extension=php_oci8_11g.dll (.dll is optional, not required)

oci8.default_prefetch = 100

https://pecl.php.net/package/oci8 (for XAMPP on Windows thread safe) ver. 2.2.0

2018-12-10 copy 1_php_oci8-2.2.0-7.4-ts-vc15-x64.zip to J:\xampp\php\ext and unzip php_oci8_11g.dll .

CLI PHP : J:\xampp\php\php.exe (before I used J:\wamp64\bin\php\php7.2.9\php.exe)

ORACLE 11g OCI8 EXTENSION ON NETWORK : OR for PC on on network ? : Feb 6 2018 Christopher Jones : ORACLE CLIENT LIBRARIES of same 32-bit or 64-bit architecture as PHP and are first in PATH. If you use Instant Client you need to have the correct VS Redistributable, see

  1. 64 bit http://www.oracle.com/technetwork/topics/winx64soft-089540.html or
  2. 32 bit http://www.oracle.com/technetwork/topics/winsoft-085727.html


For XAMPP on WINDOWS just install https://getcomposer.org/Composer-Setup.exe from page https://getcomposer.org/download/ .

WAMP does not like php in PATH variable. So composer update does not work. [*master] J:\awww\w\fwphp> J:\wamp64\bin\php\php7.2.9\php.exe C:\composer\composer.phar update (1) or better C:\composer\composer7.bat : Save the file along with the originally installed composer.bat @echo OFF :: in case DelayedExpansion is on and a path contains ! setlocal DISABLEDELAYEDEXPANSION J:\wamp64\bin\php\php7.2.9\php.exe “%~dp0composer.phar” %* Now call php7 composer with the new command: [*master] J:\awww\w\fwphp> composer7 selfupdate (1.7.2, Use composer self-update –rollback to return to version 1.7.1) composer7 update (2) is same as (1)


see https://github.com/slavkoss/fwphp#swfw


WAMP 64 bit 2018-05-25 on Windows 10 64 bit – I do not use WAMP or ZWAMP anymore

Seems simpler than ZWAMP – no entries in PATH variable. Composer works after reinstal (asks php.exe dir) – see below.

Composer manual Command-line installation – I do not use this

For XAMPP on WINDOWS just install https://getcomposer.org/Composer-Setup.exe from page https://getcomposer.org/download/ .

To automate the installation on Linux only, use the guide on installing Composer programmatically.

  1. Deinstall Composer if installed
  2. cd J:\wamp64\www\fwphp J:\wamp64\bin\php\php5.6.35\php.exe -v PHP 5.6.35 (cli) (built: Mar 29 2018 14:27:15) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
  3. J:\wamp64\bin\php\php5.6.35\php.exe -r “copy(‘https://getcomposer.org/installer‘, ‘composer-setup.php’);”J:\wamp64\bin\php\php5.6.35\php.exe -r “if (hash_file(‘SHA384’, ‘composer-setup.php’) === ‘544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;” outputs : Installer verifiedJ:\wamp64\bin\php\php5.6.35\php.exe composer-setup.phpoutputs : Composer (version 1.6.5) successfully installed to: J:\wamp64\www\fwphp\composer.phar Use it: php composer.pharJ:\wamp64\bin\php\php5.6.35\php.exe -r “unlink(‘composer-setup.php’);”The 4 lines above will, in order:
    1. Download the installer to the current directory
    2. Verify the installer SHA-384 which you can also cross-check here https://composer.github.io/pubkeys.html
    3. Run the installer – will check some php.ini settings, warn you if they are set incorrectly, and then download the latest composer.phar in the current directory
    4. Remove the installer
  4. Create a new composer.bat file alongside composer.phar: J:\wamp64\www\fwphp>echo @J:\wamp64\bin\php\php5.6.35\php.exe “%~dp0composer.phar” %*>composer.bat
  5. Add directory J:\wamp64\www\fwphp to your PATH environment variable if it isn’t already. For information on changing your PATH variable, please see this article https://www.computerhope.com/issues/ch000549.htm and/or use Google.
  6. Close your current terminal. Test usage with a new terminal: C:\Windows\System32>composer -V Composer version 1.6.5 2018-05-04 11:44:59

3. Zwamp server development ibrowser menu

HOME     2.April.2016 see https://github.com/slavkoss/fwphp
to download learning php code for :

Own php MVC framework (main menu) skeleton primary for learnig or using in applications.

Tested on: Windows 10 64 bit PHP 5.5.30 (min. 5.4), portable ZWAMP server menu SW (I briefly tried 4-5 others but ZWAMP with unpacking ZIPs & little config works best for me !! Others portable are “portable”.

Newest WAMP 3.0.4 seems excellent but I do not know how to use Composer with it. XAMPP is also not clear enough to me. (Same as others).

fwphp properties:

  1. newest php programming techniques, excellent learning start for Laravel, Falcon, yii2, codeigniter…
    or some micro php fw but also to build upon own main menus.
  2. MVC code organization
  3. classes grouped into namespaces with autoloading (on demand loading)
  4. advanced router with pretty URLs (Apache mod_rewrite)
  5. keys in routing tbl are regular expressions not strings
    Comming soon :
  6. controllers (programs that decide the response they are going to return as views to users)
    with action filters (useful for authentication) – partially finished
    Planned :
  7. views (presentation code) including template Twig engine (easier views coding)
  8. models (data handling code, DBInterface code) with on-demand DB connecting (resoutce friendly database connectivity)
  9. possible environment switchings (environment specific config & error handling)

All my learning/testing php code :
my blog http://phporacle.altervista.org/
or github https://github.com/slavkoss/fwphp/

2.Sept.2015 Download – see site_ver2.rar from my article 9. Here is important lsweb.php – excellent for development (and very simple once you understand it).

zwamp.rar – this is old code, use it only to see how to work with static class elements. Folder names in .rar are simmilar to my development site folder names. (All is tested with  ~newest 64 bit SW). Contains scripts to learn higher level begining PHP :

  1. Apache & php config scripts
  2. zwamp scripts – main development menu
  3. ls scripts – web server dirs navigation
  4. yiiinfo scripts

Goal is basic web development site. Best way to learn is start with small portion of code and add few lines step by step.

May 2015  Code refactored 3 :  Not finished yet, later I shall write new article “Web development and production site (virtual hosts, aliases) on Windows 8.1 , Oracle 11gXE (and 11g), PHP (all 64 bit) on hard disk and on Usb stick“. Code refactoring 3 consists of:

  1. simplify config class with static variables
  2. simplify ls scripts for web server dirs navigation
  3. simplify DBI – I tested PDOOCI DBI (Eustáquio Rangel http://github.com/taq/pdooci) –works.  I think PDOOCI is usefull becouse it is PDO code sintax layer on OCI8 DBI code layer. One day, when PHP PDO will no more be experimental PDOOCI will not be needed.
    Eustáquio made also PHPreports (also on Github)

April. 2015 Code refactored 2 :

  1. config file defines constants and contains config class with static variables (visible in all scripts, can be changed). This is last large refactoting.
  2. Added top menu – I suppose best and simplest.
  3. explanations in this page for now are not updated but code is in .rar at top of this page.
  4. Now this scripts are : OOP, SPA, MVC domain-style, PHP outside web doc root, (paths & URLs) set up with constants and static class variables.

Feb. 2015 Code refactored 1 – php outside web doc root:
Intro explanations for now not updated. Now this scripts are :
OOP, SPA, MVC domain-style, PHP outside web doc root.

10 scripts – It is not easy – same as yii2 requirements scripts. Both examples are excellent for learning PHP.

  1. Installing Apache, PHP, Oracle 11XE (all 64 bit)
  2. 11g XE on Win 8.1.1, both 64bit – APEX VERSION 4.2.5,  Maj 24, 2014
  3. Zwamp server development ibrowser menu – all on Win 8.1.1, 64bi
  4. How to recognize mobile device – oop, spa, mvc domain-style, php outside web doc root

zwamp_taskbartray_iconzwamp<– Z_WAMP right click menu – Right click on house icon first left in the bottom

Page with blue Z: icon is output of view script view_3cols_list.php

http://sourceforge.net/projects/zwamp/files – operating system (32-bit/i386 or 64-bit/x86_64).

MVC scripts which create this home page (ee bits 1-4 on picture above).

SPA = Single Page web Application
DOMAIN STYLE CODE structure = app. (form) scripts are in ONE subdir (and its subdirs), and index.php, if needed, is in dir above this ONE application directory.

Eg – this DEVELOPMENT MAIN MENU SCRIPTS are in zwamp dir,
– Controller script: zwamp.php and all other .php, .css, .jpg… can be in same dir. (no subdirs becouse it is small app.).

ZWAMP has no such home page, I made it from WAMPs home page, with many changes :

  1. SPA was excellent
  2. DOMAIN STYLE CODE was not implemented – everything was in appl. root dir, I had problems showing pictures (eg $imgwrench = “background: …)…
  3. MVC not clear I had work on it…

bit 1.Alati (tools), eg link instalirano

  1. view_3cols_list.php - View main body: lin.14: 
    $fleview_instalir = str_replace('zwamp.php',
    ...MENU BIT CODE lin. 36 : 
    <a style="${imgwrench}" target="_blank" href="?instalirano=1">
    ...CODE AT THIS PAGE BOTTOM lin 144: 
    $fleview_instalirano - Installed on my PC kod edit 
    kod_edit_run($mdpath.$rel_apldir_adr, basename($fleview_instalir));
  2. zwamp.php - Controller: if (isset($_GET['instalirano'])) {include(  
    $mdpath.$rel_apldir_adr.'/view_instalirano_20150106.html' ); exit()

Menu “2.Programi (projekti)” is list of dirs ($projectContents) not in array $projectsListIgnore

  1. zwamp_conf.php – Configuration
    1. is model script for dirs list (better not but this is simple example)
    2. and stores label “2.Programi (projekti” in array $txtlang (see script code)
    $txtlang array contains texts for more languages.

    1. Model: dirs list model code in zwamp.conf:
    $projectContents = ''; if ($idmape = opendir($mdpath)) 
    { while (false !== ($mapa = readdir($idmape)))
    { //if ($mapa != "." && $mapa != "..") 
    { if (is_dir($mdpath."/".$mapa) === true 
         && !in_array($mapa,$projectsListIgnore) ) 
    { //echo "DIRECTORY: ".$mapa.'<br />'; 
       $projectContents .= '<li>' 
      .'<a style="'.$imgdirgo.'" target="_blank" href="' 
    .( $suppress_localhost ? 'http://dev:8083/inc/fw/' : '' ) 
    .$mapa.'">'.$mapa .'</a>' .'</li>'; } else { 
    //echo "FILE: ".$mapa.'<br />'; } } closedir($idmape); }
    if (empty($projectContents)) $projectContents = 
  2. view_3cols_list.php – View main displays array $projectContents :
    <ul class="projects">

Menu “3.Aliasi i virt.hostovi” is list of files ($aliasContents)

  1. zwamp_conf.php – Configuration (Aliases are .conf files in dir “alias” below Z:.)
    1. is model script for files list (better not but this is simple example)
    2. and stores label “3.Aliasi i virt.hostovi” in array $txtlang (see script code)
    $txtlang array contains texts for more languages.

    1. Model: files list model code in zwamp.conf:  
    $aliasContents = '';
    // ucitavanje liste (récupération) alias-a
    if ($idmape = opendir($aliasDir))
    while (false !== ($konfig_file = readdir($idmape)))
    { if (!is_dir($aliasDir.$konfig_file) 
        && strstr($konfig_file, '.conf'))
    { //echo "DIRECTORY: ".$konfig_file.'<br />';
    $alias_ime = str_replace('.conf','',$konfig_file);
    $urlbit = $alias_ime;
    if ($alias_ime == 'dev') { // http://dev/
    // apache sada nece dodati localhost/ ispred dev :
    $urlbit = 'http://'.$alias_ime ;
    $alias_ime = $alias_ime . ' (vhost)';
    } else // svi ostali aliasi su kao adminer ispod .sys :
    { // /.sys/adminer tj http://localhost/adminer/
       $urlbit = 'http://dev/'.$alias_ime ;
    } ;
    $aliasContents .=
    '<li>'.'<a style="'.$imgdir.'"'
    . ' href="'.$urlbit.'">'.$alias_ime.'</a>'.'</li>';
    } else {
    //echo "FILE: ".$konfig_file.'<br />';
    if (empty($aliasContents))
       $aliasContents = "<li>" . $txtlang[$jezik]['txtNoAlias']."</li>\n";
    else $aliasContents = 'Aliasi su .conf u mapi "alias" ispod Z:.'
        .'<br />'.'Služe za aplik. u mapi "apps" ispod Z:.'
  2. view_3cols_list.php – View main displays array $aliasContents :
    <ul class="aliases">

List “4.Server configuration” is list of PHP extensions ($loaded_extensions)

  1. zwamp_conf.php – Configuration
    1. is model script PHP extensions (better not but this is simple example)
    2. and stores label “3.Aliasi i virt.hostovi” in array $txtlang (see script code)
    $txtlang array contains texts for more languages.

    1. Model: PHP exstensions list model code in zwamp.conf:  
    $phpExtContents = '';
    // read liste des PHP extensions
    $loaded_extensions = get_loaded_extensions();
    // [modif oto] classement alphabétique des extensions
    foreach ($loaded_extensions as $extension)
    $phpExtContents .=
    "<li style=\"${imgplugin};\">${extension}</li>;

    view_3cols_list.php – View main displays array $phpExtContents :



II. Notepad Replacer – handy for taskbartrayicon-rightclickmenu, but Notepad++ workspaces, projects and sessions are enough.

Replace Microsoft Notepad with Notepad++ (windows 8) :

Regedit node created with NotepadReplacerSetup-1.1.6.exe :

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe.

string (REG_SZ) name “Debugger”
value “C:\Program Files (x86)\Notepad Replacer\NotepadReplacer.exe” /z –BEZ ” i BEZ /z

which opens J:\aplp\aplp\3_edit\3_Notepad++\notepad++.exe


  1. C:\Windows\system32\drivers\etc\hosts       localhost
    ::1             localhost     dev
    ::1     dev

  2. J:\zwamp\vdrive\.sys\Apache2\conf\httpd.conf

    or   Z:\.sys\Apache2\conf\httpd.conf

  3. J:\zwamp\vdrive\.sys\Apache2\conf\vhosts.conf

    or Z:\.sys\Apache2\conf\vhosts.conf

    # ZWAMP does:   (subst Z: “J:\zwamp\vdrive”)

    # http://dev:8083/
    <VirtualHost *:8083>
    Options All
    #Options +Includes +FollowSymLinks +Indexes +MultiViews
    DocumentRoot “J:\dev_web\htdocs
    ServerName dev
    </VirtualHost># http://yii:8083/   – not available when listening port 8083 !?
    <VirtualHost *:8083>
    DocumentRoot “J:\dev_web\htdocs\aplyii\frontend\web
    ServerName yii

    # ———————————
    # http://localhost:8083/
    <VirtualHost *:8083>
    DocumentRoot “J:\zwamp\vdrive\web
    ServerName localhost

  4. J:\zwamp\vdrive\.sys\php\php.ini



  5. J:\dev_web\htdocs\index.php

    (if needed). Includes zwamp scripts – which all are outside Apache doc.root  J:\dev_web\htdocs (http://dev:8083/):require(realpath($_SERVER[‘DOCUMENT_ROOT’].’/../inc/zwamp/zwamp.php’)) ;

  6. J:\dev_web\inc\zwamp\zwamp.php

    – Controller outside Apache doc.root  (was : J:\dev_web\htdocs\01programi\zwamp\zwamp.php)
    // 3. SHOW VIEW BITS – ee THIS SPA WEB PAGE – Single Page App.
    // ************************************************************
    echo <<< EOPG
    <br /><br />
    <br /><hr />
    * http://dev:8083/ = Apache virt.host
    *           or zwamp docroot: http://localhost/
    * J:\dev_web\inc\zwamp\zwamp.php
    *           or J:\zwamp\vdrive\web\index.php
    *               ~~~ C O N T R O L L E R ~~~
    * SPA web page (Single Page App.) – no url calls
    * DOMAIN STYLE code organization – every app (page, oracle form form) own subdir
    *SHOWS VIEWS: main menu (1,2,3):
    *             1.Alati (tools & help)
    *             2.Programs (projects, dirs)
    *             3.Aliases & virt.hosts
    *             4.List below (php extensions)
    *             … some help texts
    * No DBI – CRUD scripts (could be sqlite for langs).
    *        – No page params of  p o s t  type – no forms
    * 1.1 Display image code (from zwamp_mdl.php)
    * 1.2 Language icons in page hdr top right
    * 1.3b                  URL  C A L L – Location ()
    * No page params of  p o s t  type – no forms – no DBI
    * ********************************************************
    * ********************************************************
    * ********************************************************
    *  3. SHOW VIEW BITS – ee THIS SPA WEB PAGE – Single Page App.
    * ********************************************************

  7. J:\dev_web\inc\zwamp\zwamp_mdl.php

    – Configuration, set up, data (img code !)

  8. J:\dev_web\inc\zwamp\zwamp_hdr.php

    – View main hdr

  9. J:\dev_web\inc\zwamp\view_3cols_list.php

    – View main body

  10. J:\dev_web\inc\zwamp\view_zwamp.php

    – View zwamp and simmilar view code bits

  11. Helpers – utils

    & phpinfo & edservertxt.php &

    // J:\dev_web\inc\utl\kod_edit_run.php
    function kod_edit_run($script_dir_path, $script_name, $web_docroot_url)
    echo <<< EOKOD
    <a href=”$web_docroot_url/inc/utl/showsource.php
    ”  target=”_blank”>&nbsp;kod</a>

    <a href=”$web_docroot_url/inc/utl/edservertxt.php
    ” target=”_blank”>&nbsp;edit</a>

    <a href=”$web_docroot_url/phpinfo_inc.php
    ” target=”_blank”>&nbsp;phpinfo</a>
    /* call it so:
    $idx       // script_dir_path
    , $idxscript // script_name
    , MDURL);    // web_docroot_url = (Apache) web server URL