16. Learn chess with free “Scid vs PC”

Learn chess with free “Scid vs PC” (commercial “Fritz”)

Scid is a chess DB app. With it you can play chess – browse DBs  of chess games (eg *.pgn game descriptions), edit games (PGNs) and search for games in opened game list by various criteria.

We can paste PGN in Scid (Edit -> paste PGN) or “Open” icon loads file (may contain more PGNs).

Scid chess player uses its own special three-file DB format which is very compact and fast, but it can convert to and from the standard PGN (Portable Game Notation) format. SAN means Standard Algebraic movesNotation eg halfmove “1.e4” – White or “1…e5” – “…” is Black.

Note that scid can read Gzipped PGN file directly, so if you have a large PGN file compressed with Gzip to save disk space, you do not have to un-gzip it first.  (gz archive may contain oly one file e.g. mybase.pgn.gz).

PHP chess players (programming source PHP code)

For me are good only to learn PHP (on Github are 4-5, all unfinished). To learn chess free “Scid vs PC” offers much more. You  eed full time work more monts to achive simmilar functionality with PHP – why waste time ?

Only advantage is using html tags in annotations  (eg <ol> <li>… Scid formats annotations worser, Fritz worser than Scid.)

PGN example of annotated game description

{Example of <b>positional play…} is annotation

( 7…Qe7 {saves R if White plays so :} 8.Qxb7 Qb4+ { forcing Q exchange.} ) is variation “(…)” which contains annotation {…}.
We can play variations and make own variations  – it is best way to learn chess.

My Github repo contains Many PGNs :
https://github.com/slavkoss/fwphp/tree/master/fwphp/glomodul/phpchess/games

[Event “diag. 1 G0001 Koblenz or Koblencs School chess game 1961”]
[Site “opera house in Paris, during Bellini’s opera Norma or Barber of Seville”]
[Date “1858.??.??”]
[Round “?”]
[White “Morphy“]
[Black “konsultants (alleati)”]
[Result “1-0”]
[ECO “C41”]
[Opening “Philidor defense“]
[Annotator “pag. 4 diag 1”]
[PlyCount “33”]
[Comment “Positional play (strategy) preparation for combination.
Black – two strong amateurs: the German noble Karl II, Duke of Brunswick and the
French aristocrat Comte Isouard de Vauvenargues.”]

1. e4 e5 {Example of <b>positional play to prepare combinations</b> in
“Romantic Era” games
:
<ol> <li>rapid development <li>center control <li>open verticals and diagonals <li>value of sacrifices in mating combinations… </ol> }

2. Nf3 d6 {d6 is Philidor’s Defence, named after Francois-Andre Danican
Philidor, the leading chess master of the second half of the 18th century (100
years before Morphy) and a pioneer of modern chess strategy. He was also a noted
opera composer. It is a solid opening, but <b>slightly passive</b>, and it
ignores the important d4-square. Most modern players prefer 2…Nc6, and 2…Nf6
– <b>Petrov Defence</b>.}

3. d4 Bg4 {3…Bg4 is considered an inferior move today. Black to maintain
material equality, he must surrender the bishop. Capturing a knight that has
only moved once (time).
3…Bg4 was accepted theory at the time.[1] Today 3…exd4 or 3…Nf6 are usual.
Philidor’s original idea, 3…f5, is a risky alternative.}

4. dxe5 Bxf3 {If 4…dxe5, then 5.Qxd8+ Kxd8 6.Nxe5 and White wins a pawn and
Black has lost the ability to castle. This knight threatens the bishop on g4 as
well as the f7 square forking the king and rook.
Black can 4…Nd7 5.exd6 Bxd6, when he is down a pawn but has some compensation
in form of better development.
4…Bxf3 Black moves the bishop for a second time to capture a knight that has
only moved once (time). Black also gives up the bishop pair, which weakens the
light squares. }

5. Qxf3 {Steinitz’s recommendation 5.gxf3 dxe5 6.Qxd8+ Kxd8 7.f4 is also good
(doubled pawns
– pawn structure). Morphy prefers to keep the queens on. }
5…dxe5 {After Black recaptures the pawn on e5, White has a significant lead in
development.}

6. Bc4 {is move that has many great attributes: 1. develops a piece. 2.
checkmate is threatened with 7. Qxf7. 3. frees up last square for White to
castle (time, space, and king safety).}
6…Nf6 { BLUNDER After White’s next move, both f7 and b7 will be under attack.
Better is Q protect f7-p making White’s next move less potent.}

7. Qb3
7…Qe7
( {Black’s only good move but blocks f8-B and kingside castling.}
7…Nc6 {leads to mate} 8.Bxf7+ Ke7 {or Kd7} 9.Qe6 )
( 7…Qd7 {Black loses R } 8.Qxb7 {9.Qxa8 can not be stopped}
(8. Qxb7 Qc6? 9.Bb5 {would lose Q})
)
( 7…Qe7 {saves R if White plays so :} 8.Qxb7 Qb4+ { forcing Q exchange.} )

8. Nc3 {(8. Qxb7 Qb4+) Morphy could have won a pawn by 8.Qxb7 Qb4+ 9.Qxb4 Bxb4+.
White can also win material with 8.Bxf7+ Qxf7 9.Qxb7, but Black has dangerous
counterplay after 9…Bc5! and 10.Qxa8 0-0, or 10.Qc8+ Ke7 11.Qxh8 Bxf2+!. “But
that would have been a butcher’s method, not an artist’s.” (Lasker).[2] In
keeping with his style, Morphy prefers rapid development and initiative over
material.

At depth 42 on Stockfish 11 the evaluation for the top 3 moves is as follows:

1. Qxb7 (2.15)
2. Nc3 (2.10)
3. 0-0 (1.61)
}
c6 {The best move, allowing Black to defend his pawn without further weakening
the light squares, which have been weakened by Black trading off his
light-square bishop.}

9. Bg5 {Black is in what’s like a zugzwang position here. He can’t develop the
[Queen’s] knight because the pawn is hanging, the bishop is blocked because of
the Queen.–Fischer}
b5 {Black attempts to drive away the bishop and gain some time, but this move
allows Morphy a strong sacrifice to keep the initiative. This move loses but it
is difficult to find anything better; for example 9…Na6 10.Bxf6 gxf6 11.Bxa6
bxa6 12.Qa4 Qb7 and Black’s position is very weak.}

10. Nxb5 {Morphy chooses not to retreat the bishop, which would allow Black to
gain time for development.}
cxb5 {Black could have prolonged the game by playing 10…Qb4+, forcing the
exchange of queens, but White wins comfortably after either 11.Nc3 or 11.Qxb4
Bxb4+ 12.c3!}

11. Bxb5+ {Not 11.Bd5? Qb4+, unpinning the knight and allowing the rook to evade
capture.}
Nbd7

12. O-O-O Rd8 {The combination of the pins on the knights and the open file for
White’s rook will lead to Black’s defeat.}

13. Rxd7 Rxd7 {Removing another defender.}

14. Rd1 {Compare the activity of the white pieces with the idleness of the black
pieces. At this point, Black’s d7-rook cannot be saved, since it is pinned to
the king by the bishop and attacked by the rook, and though the knight defends
it, the knight is pinned to the queen.}
Qe6 {Qe6 is a futile attempt to unpin the knight (allowing it to defend the
rook) and offer a queen trade, to take some pressure out of the white attack.
Even if Morphy did not play his next crushing move, he could have always traded
his bishop for the knight, followed by winning the rook.}

15. Bxd7+ Nxd7 {If 15…Qxd7, then 16.Qb8+ Ke7 17.Qxe5+ Kd8 18.Bxf6+ gxf6
19.Qxf6+ Kc8 20.Rxd7 Kxd7 21.Qxh8 and White is clearly winning. Moving the king
leads to mate: 15…Ke7 16.Qb4+ Qd6 (16…Kd8 17.Qb8+ Ke7 18.Qe8#) 17.Qxd6+ Kd8
18.Qb8+ Ke7 19.Qe8# or 15…Kd8 16.Qb8+ Ke7 17.Qe8#.}

16. Qb8+ {Morphy finishes with a queen sacrifice.}
Nxb8

17. Rd8# 1-0

World Chess Champions

Chess Player Directory (chessgames.com)

Text (part) and images (i001…) in this page are from page
https://en.wikipedia.org/wiki/World_Chess_Championship
.

See also “The golden treasury of chess” (till 1969) by I. AL HOROWITZ
Dedicated To H. N. Pillsbury (1872-1906)

Carlsen  i001 Current (2021) world champion is Magnus Carlsen of Norway  2013-… He defeated Viswanathan Anand in 2013.The chess games of Magnus Carlsen

Kasparov used some of openings from his DB while coaching Magnus Carlsen. In 2009. Under Kasparov’s tutelage, Carlsen became the youngest ever to achieve FIDE rating higher than 2800, and the youngest ever world number one. Carlsen 2014:
https://chess24.com/en/read/news/magnus-carlsen-on-reddit-ask-me-anything Particularly impressed by the 1994 Candidates match between Anand and Kamsky.

2014 Candidates by Anand’s win against Aronian in the first round – It’s not often that you beat the number 2 player in the world purely by technique.

https://chess24.com/en/read/news/candidates-round-1-the-tiger-is-back
.
His favorite chess book is Kramnik: My Life & Games. Carlsen : In order to become a Master or an International Master, I think you can start later and it’s more about putting in the time and hard work rather than talent. Anand, Kramnik, Topalov and Svidler. I prefer to give mainstream openings my own spin.

What’s your favorite non-chess book? Close race between several Donald Duck comics (seriously).

Unofficial champions (pre-1886)  – Pre-Morphy period ~350 years
1510-1850

Leading players before the World Chess Championships

Name Year Country Age
Ruy López de Segura 1559–1575 Spain 29–45
Leonardo di Bona c.1575 Naples 33
Paolo Boi c. 1575 Sicily 47
Alessandro Salvio c. 1600 Naples c. 30
Gioachino Greco c. 1620–1634 Naples c. 20–34
Legall de Kermeur c. 1730–1755 France c. 28–53
François-André Danican Philidor 1755–1795 France 29–69
Alexandre Deschapelles 1815–1821 France 35–41
Louis-Charles Mahé de La Bourdonnais 1821–1840 France 26–45
Howard Staunton 1843–1851 England 33–41
Adolf Anderssen 1851–1858 Prussia 33–40
Paul Morphy 1858–1862 United States 21–25
Adolf Anderssen 1862–1866 Prussia 44–48
Wilhelm Steinitz 1866–1886 Austria-Hungary 30–50
Johannes Zukertort 1878–1886 England 36–44

EDO years 1850, 1851, 1858, 1870, 1877

Player                                                                                 1850       1851      1858     1870    1877

1. Morphy, Paul 2719 2741 2801
2. Baron Tassilo von Heydebrand und der Lasa 2692 2720
3. Anderssen, Adolf 2634 2673 2635 2687 2596
4. Petrov, Alexander 2621 2627 2629
5. Staunton, Howard 2609 2607
6. Löwenthal, Johann 2630
7. Paulsen, Louis 2627 2633
8. Steinitz, Wilhelm 2725 2768
9. Neumann, Gustav 2663
10. Mackenzie, George 2636
11. Potter, William 2619
12. Zukertort, Johannes 2645
13. Blackburne, Joseph 2604

Renaissance. By 1510 the old type of chess was obsolete in most of Italy and
Spain. Analysis was the ruling motive in the literature of the period. Openings
known today as the Ruy Lopez, Giuoco Piano, Petroff defense, Philidor Defense,
Bishop’s Opening and Queen’s Gambit Accepted
, were first outlined in a late 15th
century manuscript (in the Gottingen University Library).

Ruy Lopez (from Philip
II court) first appears in 1559 when this Spanish priest visited Italy and
defeated all the Roman players.

After Greco’s death in 1634, Italy produced no
outstanding players for over a hundred years.  1669, a French translation
of his collection of games  was published in Paris.

18th century coffee-houses of London and Paris were the leading centers of
chess activity ( Cafe de la Regence in Paris and Slaughter’s Coffee House in
London).  Andre D. Philidor was musician (1775 till death in 1795 he spent
spring of each year in London and the rest of the year in Paris). He was the
first to define and explain the principles of chess strategy and tactics.

First half of the 19th century Captain W. D. Evans discovered his gambit in
1824,  William Lewis,  great Howard Staunton from 1843 best. In France
Alexander Deschapelles; Pierre de Saint-Amant (“French Defense).  Central
Europe  B. Horwitz,  Russian Petroff (Petrov), Livonian, Kieseritzky.

From a purely technical point of view games of 350 years to 19th century are
not of vital importance
but one wonders whether all gains (theory, knowledge,
systematic analysis ) compensate for  spirit of freshness, of eternal
adventure, of naivete, charm, their sociable and leisurely character.

Romantic Era of chess in the second half of the 19th century was all about
gambits, sacrifices, open lines, and active pieces. Attack at all costs! Defense
is for cowards.  Fell into decline as its failures mounted against the more
pragmatic and dogmatic teachings of Wilhelm Steinitz and Siegbert Tarrasch in
the late 19th  and early 20th.

De La Bourdonnais i002 De La Bourdonnais, the world’s strongest player from 1821 to his death in December  1840

The chess games of Louis Charles Mahe De La Bourdonnais

Something resembling (Appear like; be similar,  corresponding, matching) a world championship match was the La  Bourdonnais – McDonnell chess matches in 1834, in which La Bourdonnais played a series of six matches – and 85 games – against the Irishman Alexander McDonnell, with La Bourdonnais winning a majority of the games.The idea of a chess world champion goes back at least to 1840, when a columnist in Fraser’s Magazine wrote, “Will Gaul continue the dynasty by placing a fourth Frenchman on the throne of the world? — the three last chess chiefs having been successively Philidor, Deschapelles, and De La Bourdonnais.”

i007HowardStaunton  i007 Howard Staunton After La Bourdonnais’s death [3] Englishman Howard Staunton won vs Pierre Charles Fournier de Saint-Amant, in 1843

The chess games of Howard Staunton

A letter quoted in The Times on 16 November 1843, but probably written before that, described the second Staunton vs Saint-Amant match, played in Paris in November–December 1843, as being for “the golden sceptre of Philidor.”[1] The earliest recorded use of the term “World Champion” was in 1845, when Howard Staunton was described as “the Chess Champion of England, or
… the Champion of the World”.[5]Howard Staunton is considered to have been the strongest chess player in the world during 1840s.The first known proposal that a contest should be defined in advance as being
for recognition as the world’s best player was by Ludwig Bledow in a letter to Tassilo von der Lasa, written in 1846 and published in the Deutsche Schachzeitung in 1848: “… the winner of the battle in Paris [in 1843, when Staunton defeated St. Amant] should not be overly proud of his special position, since it is in Trier that the crown will first be awarded.” This was in reference to a proposed tournament to be held in Trier, where von de Lasa resided; but Bledow died in 1846 and the proposed tournament did not take place.[1] Similarly, the London 1851 chess tournament was described beforehand by some contemporary commentators as being for the world championship,[6] but there is no mention afterwards in the tournament book by Staunton.[7]

i003Staunton and Pierre Saint-Amanti003 Jean Henri Marlet : Howard Staunton vs Pierre Saint-Amant
, on 16 December 1843. This chess match was regarded as an
unofficial world championship.
i005Morphy_Löwenthal_1858.jpg  i005, i004 Paul Morphy playing against Hungarian chess master Johann Löwenthal 1858.

The chess games of Paul Morphy

Morphy  at twelve years of age defeated visiting Hungarian master Johann Loewenthal in a three game match.Morphy played matches against several leading players, crushing them all.[11][12]Morphy’s sudden withdrawal from chess at his peak led to his being known as
“the pride and sorrow of chess

i004Paul_Morphy_Daguerreotype.jpg  i004 Paul Morphy a chess prodigy from New Orleans Louisiana, United States.

Dominated all of his opposition during his brief chess career. Due to his astounding achievements, an official World Championship match was only held after his death.Rich child, greatest natural chess talent. 1858 defeated Anderssen and many other Europeans and retited when was 22 years old (declined to play or discuss chess).
Article in Harper’s Weekly (9 October 1858; by C.H. Stanley) was uncertain
about whether Morphy vs Harrwitz match was being for the world championship.[6] Soon after, Morphy offered pawn and move odds to anyone who played him. Finding no takers, he abruptly retired from chess the following year, but many considered him the world champion until his death in 1884.Brilliancy and accuracy of combinations, radical innovator. It was he who introduced the innovation which proved to be a death-knell (smrtno zvono) of romantic type of chess in which brilliancy was the be-all and end-all of every game. Correctness of his moves instead useless sacrifices.
Intuitive with the logical as only the great artist can.  Note how quickly
Morphy made converts.Many report that he was able to recite from memory nearly the entire Civil Code of Louisiana (3,500 articles). Fischer  and Viswanathan Anand ranked Morphy among the ten greatest chess players of all time. Fischer described him as “perhaps the most accurate player who ever lived“. Morphy learned to play chess by watching games between his father and uncle.
Morphy was a player who intuitively knew what was best, and in this regard he has been likened to Jose Capablanca. He was, like Capablanca, a child prodigy; he played quickly, would draw or even win games despite getting into bad positions. Anderssen said that, after one bad move against Morphy, one might as well resign. Garry Kasparov said that Morphy realized quarter-century before Wilhelm Steinitz had formulated principles :

  1. fast development of the pieces
  2. domain of the centre
  3. opening lines – verticales, diagonales, horizontales

Reuben Fine : “[Morphy’s] glorifiers went on to urge that he was the most
brilliant genius who had ever appeared But if we examine Morphy’s record and games critically, we cannot justify such extravaganza. He was so far ahead of his rivals that it is hard to find really outstanding examples of his skill.”

Born to a wealthy and distinguished (ugledna) family in New Orleans 1837, died on July 10. 1884 at the age of 47 by stroke brought on by entering cold water in his bathtub after a long walk in the midday heat. The Morphy mansion 417 Royal Street which backs up to Bourbon Street, sold by the family in 1891, became the site of the well-known restaurant Brennan’s.  In accord with the prevailing sentiment of the time, Morphy esteemed chess only as an amateur activity, considering the game unworthy of pursuit as a serious occupation. Chess professionals were viewed in the same light as professional gamblers.  Morphy was never able to establish a successful law practice – 1861 outbreak of the American Civil War, suffered from delusions of persecution (chasing, progon). He lived a life of idleness, living off his family’s fortune, was cared by his sister and mother.

i006Anderssen   i006  German Adolf AnderssenThe chess games of Adolf Anderssen

1851 new age :  first International Chess Tournament in London, Adolph
Anderssen of Berlin won – Another great player, almost as great as Morphy, and in the opinion of some capable judges even superior to him. Anderssen was best about ten years before Morphy’s appearance. Also brilliancy and accuracy of combinations. Anderssen died of a heart attack at the age of 60.Morphy  vs Anderssen 1858  7-2, 2 draws, after which Morphy was toasted across the chess-playing world as the world chess champion.Anderssen is seen as the world’s leading player from 1851, until he was defeated by Paul Morphy in 1858. After Morphy’s retirement from chess, Anderssen was regarded as the strongest active player, especially after winning the London 1862 chess tournament.
The 1851 London tournament was won by Adolf Anderssen, establishing
him as the world’s leading player.[8] Anderssen has been described as the
first modern chess master.[9] However, there is no evidence that he was widely acclaimed at the time as the world champion, although in 1893 Henry Bird retrospectively awarded the title to Anderssen for his victory.[10]

i006Anderssen

From 1866

The first generally recognized world championship took place in 1886, when the two leading players in the world, Wilhelm Steinitz and Johannes
Zukertort
, played a match, which was won by Steinitz.

From 1886 to 1946, the champion set the terms, requiring any challenger to raise a sizable stake and defeat the champion in a match in order to become the new world champion. Following the death of reigning world champion Alexander Alekhine in 1946, FIDE (the International Chess Federation) took over administration of the World Championship, organizing their first championship in a 1948 tournament.

In 1993, reigning champion Garry Kasparov broke away from FIDE,
which led to a rival claimant to the title of World Champion for the next
thirteen years. The titles were unified at the World Chess Championship
2006
, with the unified title again administered by FIDE.

Since 2014, the schedule has settled on a two-year cycle with a  championship held in every even year.

Though the world championship is open to all players, there are separate
events and titles for the Women’s World Chess Championship, the World
Junior Chess Championship (for players under 20 years of age, though there are younger age events also), and the World Senior Chess Championship (for men above 60 years of age, and women above 50). There are also faster time limit events, the World Rapid Chess Championship and the World Blitz Chess Championship. The World Computer Chess Championship is open to computer chess programs and hardware.

Since 2013, the Candidates Tournament has been an 8-player double round robin tournament, with the winner playing a match against the champion for the title. The Norwegian Magnus Carlsen won the 2013 Candidates and then convincingly defeated Anand in the World Chess Championship 2013.[66][67]

Beginning with the 2014 Championship cycle, the World Championship has followed a 2-year cycle: qualification for the Candidates in the odd year, the Candidates tournament early in the even year, and the World   Championship match late in the even year. Each of the past three cycles has resulted in Carlsen successfully defending his title: against Anand in 2014;[68] against Sergey Karjakin in 2016;[69] and against Fabiano Caruana in 2018. His last two defences were decided by tie-break in rapid games.[70]

The COVID-19 pandemic disrupted the 2020 Candidates Tournament, causing the next world title match to be postponed from 2020 to 2021.[71]

i008Wilhelm_Steinitzi008  1866, Wilhelm Steinitz narrowly defeated
Anderssen in a match (8-6, 0 draws).The chess games of Wilhelm Steinitz

Age of Steinitz 10 years till 1890

Against Johannes Zukertort in 1872 (7-1, 4 draws).
Vienna 1873 chess tournament
Against Joseph Henry Blackburne by a crushing 7-0 (0 draws) in 1876.
Zukertort
 1886, won by Steinitz.
Mikhail Chigorin in 1889,
Isidor  Gunsberg in 1891, and Chigorin again in 1892.

Steinitz was genius accused “destroyed brilliancy in chess” – not true.

Steinitz the first master of positional chess, was a strikingly (impressing, hitting, prominent) brilliant player, not only as a mettlesome (spirited, proud and unbroken spirit) youngster, but even as a feeble (lacking in force, effectiveness, strength, vigour, strength, vitality, dynamism, energy) old man.

L1: Game No. 73 shows us how Steinitz played at the beginning of his career –
enthusiastic disciple of the attacking school. Very shortly thereafter he
experienced a thoroughgoing conversion. He became obsessed with the
deeply-rooted carelessness, flashiness (exhibitionism, immodesty, tasteless
showiness) and frequent unsoundness of attacking school oposed to
combinations of Morphy, with their :

  1. natural development
  2. logical preparation
  3. accurate execution

A pervasive interest in the defense became his life-time passion (desired
intensely); he was fascinated by the idea of refuting (prove to be false or
incorrect)  an unsound attack, of demonstrating to the opponent that one
cannot lightly toss away pawns, or worse pieces, without retribution, that
hit-or-miss and helter-skelter attacks should not be permitted to achieve their
goal. All have absorbed fundamentals of his theories,  whether they have
agreed with him or agreed to disagree also poets of the chessboard as Zukertort, Tchigorin and Blackburne – their attacking play was purified and raised to finer artistic levels by Steinitz’s probing and fruitful criticism.

In the classical period (say, from Steinitz till 1935 Nimzowitsch’s death)
most players were technicians, with Capablanca as the most famous example.

Apart from the Blackburne match, Steinitz played no  competitive chess from 1874 to 1882. During that time, Zukertort emerged as the world’s leading active player, winning the Paris 1878 chess tournament. Zukertort then won the London 1883 chess tournament by a convincing 3-point margin, ahead of nearly every leading player in the world, with Steinitz finishing second.[13][14] This tournament established Steinitz and Zukertort as the best two players in the world, and led to a match between these two, the World Chess Championship 1886,[14][15] won by Steinitz.

Official champions before FIDE (1886–1946)
The reign of Wilhelm Steinitz (1886–1894) –
Wilhelm Steinitz dominated chess from 1866 to 1894. Some commentators date his time as World Champion from 1866; others from 1886.

1889 tournament in New York to select a challenger for Steinitz, rather like the more recent  Candidates Tournaments. Chigorin and Max Weiss tied for first place; their play-off resulted in four draws; and neither wanted to play a match against Steinitz – Chigorin had just lost to him, and Weiss wanted to get back to his work for the Rothschild Bank. The third prizewinner Isidor Gunsberg was prepared to play Steinitz.

  i009Emanuel_Laskeri009 Emanuel  Lasker (1894–1921) – won the 1894 match and succeeded Steinitz as world champion.

The chess games of Emanuel Lasker

Lasker was the World Champion for 27 years consecutively from 1894 to 1921, the longest reign of a World Champion.During that period, he played 7  one-sided World Championship matches against Steinitz, Frank Marshall, Siegbert Tarrasch and Dawid Janowski, and was only seriously threatened in a tied 1910 match against Carl Schlechter..Two young strong players emerged in late 1880s and early 1890s: Siegbert
Tarrasch and Emanuel Lasker
.[28] Tarrasch had the better tournament results at the time, but it was Lasker who was able to raise the money to challenge Steinitz.[28]

Modern Chess 15 years 1890 till 1905

Era of what is called, occasionally in rather a disdainful (insulting) tone,
“modern chess” –  great Lasker and Tarrasch, Schlechter and Maroczy, of the attacking geniuses Pillsbury (lived 34 years, seem to be adequately appreciated 1956 first ed.) and Marshall and Janowski. Positional chess begins to be pre-eminent; before the opponent can be finished off with a brilliant combination.

It is generally necessary to outplay him positionally, in order to create
favorable conditions for sacrificial play. That is why Emanuel Lasker once wrote: “If you play well positionally, the combinations will come of
themselves.”

Lasker: endgame mastery, the first chess psychologist, greatest defensive (save lost positions) player ever, World Champion 27 years. Lasker calculated extremely deeply, seeing things that others would never find resulting in great
combinations, just like all the other great tacticians. Chaotic tactical tidal
waves (like Tal did), which drowned one opponent – defensive setups that even modern computers are incapable of seeing.

Lasker was the first champion after Steinitz; although he did not defend his title in 1897–1906 or 1911–1920, he did string together an impressive run of tournament victories and dominated his opponents. His success was largely due to the fact that he was an excellent practical player. In difficult or objectively lost positions he would complicate matters and use his extraordinary tactical abilities to save the game.

Lasker’s negotiations for title matches from 1911 onwards were extremely controversial. In 1911 he received a challenge for a world title match against José Raúl Capablanca and, in addition to making severe financial demands, proposed some novel conditions: the match should be considered drawn if neither player finished with a two-game lead; and it should have a maximum of 30 games, but finish if either player won six games and had a two-game lead (previous matches had been won by the first to win a certain number of games, usually 10; in theory such a match might go on for ever). Capablanca objected to the two-game lead clause; Lasker took offence at the terms in which Capablanca  criticized the two-game lead condition and broke off negotiations.[29]

Further controversy arose when, in 1912, Lasker’s terms for a proposed match with Akiba Rubinstein included a clause that, if Lasker should resign the title after a date had been set for the match, Rubinstein should become world champion (American Chess Bulletin, October 1913).[30]

  i010José_Raúl_Capablanca_1931The chess games of Jose Raul Capablanca

Capablanca, Alekhine and Euwe (1921–1946)

i010 José Raúl Capablanca World Champion 1921 to 1927.

Moderns, Hypermoderns and Eclectics 37 years 1905 till 1942

Rubinstein, Nimzovich, Bernstein, Capablanca, Duras, Tartakower, Spielmann, Vidmar… They  applied in their games what they had learned from the reigning gods of the chessboard, but they also rebelled, as is the way of youth, and made their own additions and corrections.  Nimzovich and his young countryman Alekhine were evolving a new school of chess thought, whose effect, if not always its objective, was to turn the current chess theories upside down.
During and after the World War I, these players were joined by such masters as Reti, Bogolyubov and Breyer,  still younger players, such as Euwe,
Flohr, Kashdan, Fine, Reshevsky, Botvinnik and Keres. It is an age where
“anything goes”, older masters were rarely capable of such elasticity and
objectivity.

Steinitz: the first master of positional chess. Alekhine: dynamic,
combinative genius. Capablanca: endgame mastery and positional elegance. Tal:  attack and tactics.

Russia’s  
Alexander Alekhine
(later baturalized French), Kasparov’s main early
influence
,  took the world title from Cuba’s Capablanca in a  legendary
World Championship match held in Buenos Aires, Argentina, in 1927 – 34 games, the longest until Garry’s first match with Karpov lasted a record 48.  31 game was mostly quin’s gambit, most draw, both Alekhine and Capablanca said “no advance in chech“.

He proposed the short-lived “London Rules” for future World
Championship matches.

1914 Saint Petersburg tournament – champion must be prepared to defend his title once a year; the match should be won by whichever player first won six or eight games (the champion had the right to choose); and the stake should be at least £1,000 (about £100,000 in current terms).[29]

When Lasker resumed negotiations with Capablanca after World War I, Lasker insisted on a similar clause that if Lasker should resign the title after a date had been set for the match, Capablanca should become world champion.[29] On 27 June 1920 Lasker abdicated in favor of Capablanca because of public criticisms of the terms for the match, naming Capablanca as his successor (American Chess Bulletin, July August 1920). Nonetheless Lasker agreed to play a match against Capablanca in 1921, announcing that, if he won, he would resign the title so that younger masters could compete for it. Capablanca won their 1921 match easily.[20]

Following the controversies surrounding his 1921 match against Lasker, in 1922 world champion Capablanca proposed “London Rules“: the first player to win six games would win the match; playing sessions would be limited to 5 hours; the time limit would be 40 moves in 2½ hours; the champion must defend his title within one year of receiving a challenge from a recognized master; the champion would decide the date of the match; the champion was not obliged to accept a challenge for a purse of less than US$10,000 (about $140,000 in current terms); 20% of the purse was to be paid to the title holder, and the remainder being
divided, 60% going to the winner of the match, and 40% to the loser; the highest purse bid must be accepted. Alekhine, Bogoljubov, Maróczy, Réti, Rubinstein, Tartakower and Vidmar promptly signed them.[31]

i011Alexandre_Alekhine   i011 Alexander Alekhine
– played dynamic and imaginative chess, was World Champion
from 1927 to 1935 and again from 1937 to his death in 1946.

The chess games of Alexander Alekhine

He is the only World Champion to die while holding the title.Alekhine easily won two title matches against Efim Bogoljubov in 1929 and 1934.Alekhine agreed to place future matches for the world title under the auspices of FIDE, except that he would only play Capablanca under the same conditions that governed their match in 1927 – “London Rules”.[32] . Negotiations dragged on for several years, often breaking down when agreement seemed in sight.[20].The only match played under those rules was Capablanca vs Alekhine in 1927.[32] Alekhine, Rubinstein and Nimzowitsch had all challenged Capablanca in the early 1920s but only Alekhine could raise the US$10,000 Capablanca demanded and only in 1927.[33]Capablanca was shockingly upset by the new challenger. Before the match, almost nobody gave Alekhine a chance against the dominant Cuban, but Alekhine overcame Capablanca’s natural
skill with his unmatched drive and extensive preparation (especially deep opening analysis, which became a hallmark of most future grandmasters)
. The aggressive Alekhine was helped by his tactical skill, which complicated the game.Although FIDE wished to set up a match between Alekhine and Bogoljubow, it made little progress and the title “Champion of FIDE” quietly vanished after Alekhine won the 1929 world championship match that he and Bogoljubow themselves arranged.[43]

i012Max_Euwe_1963i012 Dutch Max Euwe, an amateur player who worked as a mathematics teacher. In 1935 Alekhine was  unexpectedly
defeated by Euwe.Alekhine convincingly won a rematch in 1937. World War II temporarily prevented any further world title matches, and
Alekhine remained world champion until his death in 1946.
AVRO tournament in 1938 was won by Paul Keres under a tie-breaking rule, with Reuben Fine placed second and Capablanca and Flohr in the bottom places; and the outbreak of World War II in 1939 cut short the controversy.[44][45]

Financing

Before 1948 world championship matches were financed by  arrangements similar to those Emanuel Lasker described for his 1894 match with Wilhelm Steinitz: either the challenger or both players, with the assistance of financial backers, would contribute to a purse; about half would be distributed to the winner’s backers, and the winner would receive the larger share of the remainder (the loser’s backers got nothing). The players had to meet their own travel, accommodation,
food and other expenses
out of their shares of the purse.[34] This system evolved out of the wagering of small stakes on club games in the early 19th century.[35]

Up to and including the 1894 Steinitz–Lasker match, both players, with their backers, generally contributed equally to the purse, following the custom of important matches in the 19th century before there was a generally recognized world champion. In the early 1920s, Alekhine,
Rubinstein and Nimzowitsch all challenged Capablanca, but only Alekhine was able to raise the US$10,000 that Capablanca demanded, and not until 1927.[33][39]

FIDE title (1948–1993)
FIDE, Euwe and AVRO

Birth of FIDE’s World Championship cycle (1946–1948)

Before 1946 a new World Champion had won the title by defeating the former champion in a match. Alexander Alekhine’s death in 1946 created an interregnum that made the normal procedure impossible. The situation was very confused.

i013Botvinnik_1936  i013 Mikhail Botvinnik was the first World Champion under FIDE jurisdiction – won 1948 (to 1963) Championship Tournament – Two of the participants at AVRO – Alekhine and former world champion José Raúl Capablanca – had died;
Max Euwe, from the Netherlands; Botvinnik, Paul Keres and Salo Flohr from the Soviet Union; and Reuben Fine and Samuel Reshevsky from the United States. However, FIDE soon accepted a Soviet request to substitute Vasily Smyslov for Flohr, and Fine dropped out in order to continue his degree studies in psychology, so only five players competed. Botvinnik won convincingly and thus became world champion, ending the interregnum.[46]The chess games of Mikhail Botvinnik

Period of Russian Hegemony and Fischer 27 years 1942 till 1972

Russian government, acting as sponsors – Botvinnik, Smyslov, Bronstein,
Keres, Geller, Tal… – peak of technical perfection, great emphasis on
openings
. Hordes of analysts finecomb existing ideas extensively and
occasionally produce interesting innovations.

Ukrainian-Soviet Grandmaster David Bronstein (200 Open Games) came as close as one can get to becoming world champion without achieving the highest title. He drew a world championship match against the mighty Mikhail Botvinnik  in 1951, but the champion retained the title with a draw. Bronstein would remain one of the strongest and most creative players in the world for many years.

Drawn 12–12 – Botvinnik-Bronstein in 1951 and Botvinnik-Smyslov in 1954 – so Botvinnik retained the title both times.

The eventual solution was very similar to FIDE’s initial proposal and to a
proposal put forward by the Soviet Union (authored by Mikhail Botvinnik). The 1938 AVRO tournament was used as the basis for the 1948 Championship Tournament.
The AVRO tournament had brought together the eight players who were, by general acclamation, the best players in the world at the time.

FIDE system (1949–1963)

Botvinnik lost to Vasily Smyslov in 1957 but won the return match in
1958, and lost to Mikhail Tal in 1960 but won the return match in 1961.

Thus Smyslov and Tal each held the world title for a year, but Botvinnik was world champion for rest of the time from 1948 to 1963.

The return match clause was not in place for the 1963 cycle. Tigran Petrosian won the 1962 Candidates and then defeated Botvinnik in 1963 to become world champion.

i014Smyslov i014 The chess games of Vasily Smyslov

Vasily Smyslov, World Champion 1957-1958.

i015Mikhail_Tal_1962  i015 Mikhail Tal, World Champion 1960-1961.

The chess games of Mikhail Tal

i016igran_Petrosian_1962  i016 Tigran Petrosian, World Champion 1963-1969.

The chess games of Tigran V Petrosian

i017Bobby_Fischer_1972  i017 Bobby Fischer in Amsterdam meeting FIDE officials in 1972. His reign as World Champion ended, for a short time, 24 years of Soviet domination of the World Championship. After becoming World Champion, Fischer did not play competitive chess for 20 years.

The chess games of Robert James Fischer

Fischer won the 1992 Fischer–Spassky rematch decisively with a score of
10–5 (Yugo dollars). After the 1962 Candidates, Bobby Fischer publicly alleged that the Soviets had colluded to prevent any non-Soviet – specifically him – from winning. He claimed that Petrosian, Efim Geller and Paul Keres had prearranged to draw all their games, and that Korchnoi had been instructed to lose to them. Yuri Averbakh, who
was head of the Soviet team, confirmed in 2002 that Petrosian, Geller and Keres arranged to draw
all their games in order to save their energy for games against non-Soviet players.[50] Korchnoi, who defected from the USSR in 1976, has never alleged he was forced to throw games. FIDE responded by changing the format of future Candidates Tournaments to eliminate the possibility of  collusion.

i018Boris_Spasski  i018 Boris Spassky lost the title match to Petrosian in 1966, but won and became world champion in 1969.[52][53]
i019KarpovThe chess games of Anatoly Karpov

Karpov and Kasparov (1975–1993)

i019 Anatoly Karpov became World Champion after Fischer refused to
defend his title. He was world champion from 1975 to 1985, and FIDE World
Champion from 1993 to 1999 when the world title was split.

Last 50 years ~1970 – 2020

English Grandmaster Mickey Adams has been England’s top player for two decades, he never reached a World Championship match like his countryman Nigel Short, who faced Garry in 1993.

Grandmaster Yasser Seirawan is a four-time US champion who became one of America’s top international players in the post-Fischer era.

Karpov, and especially the 9th World Champion, Tigran Petrosian,
were brilliant at playing quietly until their opponents slipped up. – said
Garry Kasparov. Garry once called Ukraine’s Vassily Ivanchuk
the player who has most surprised me over the board.

Karpov defended his title twice against ex-Soviet Viktor Korchnoi, first in
Baguio, the Philippines, in 1978 (6–5 with 21 draws) then in Merano in 1981 (6–2, with 10 draws).

An unbroken line of FIDE champions had thus been established from 1948 to 1972, with each champion gaining his title by beating the previous incumbent.
This came to an end when Anatoly Karpov won the right to challenge Fischer in 1975.

Karpov eventually lost his title to Garry Kasparov, whose aggressive tactical style was in sharp contrast to Karpov’s positional style. The two of them fought five incredibly close world  champ matches, 1984, 1985, 1986, 1987, 1990. In the five matches Kasparov and Karpov played 144 games with 104 draws, 21 wins by Kasparov and 19 wins by
Karpov
.

i020Garri_Kasparov   13. i020 Garry Kasparov defeated Karpov 1985.

The chess games of Garry Kasparov

He was undisputed World Champion from 1985 to 1993, and held the split title until 2000. Garry is by many as the greatest chess player of all time,  youngest World Chess Champion in history in 1985 at the age of 22 by beating Anatoly Karpov. Winning remarkable 16th game gave Garry a big lead in his 1986 World Championship title defense against Karpov. He’d won four games against only one loss. Incredibly, Garry then lost the next three games in a row and the match was tied with five games remaining. Garry retook the lead by winning game 22 and the final two games were drawn.Garry lost the 2000 World Championship match in London to Russia’s Vladimir Kramnik with a score of 6.5-8.5, with two losses and thirteen draws, no wins – 2nd time in chess history.  Garry retired from professional chess in 2005. Garry won
Linares a record 9 times, including his last official event before retiring in 2005.In February 1996, he defeated IBM’s chess computer Deep Blue
(Computer)
with three wins and two draws and one loss. 1997 Deep Blue
defeated Kasparov 3½-2½ in a highly publicised six-game match. The match was even after five games but Kasparov lost Game 6 – Deep Blue vs
Kasparov, 1997
– to lose the match. This was the first time a computer had
ever defeated a world champion in match play.Kramnik – Deep Fritz (for million dolars Bahrein, Oct. 2002) was 3 : 1 but ended 4 :4. Kramnik – Deep Fritz (fond half million dolars) Bonn 2006, 2 : 4.Since his retirement 2005, Kasparov has concentrated much of his time and energy in Russian politics. He is also a prolific author, most famously his My
Great Predecessors
series.

i021Vladimir_Kramnik_2018   i021 i021Vladimir_Kramnik_2018 (2006–2007 world champ) is of rare players rating over 2800 (first was
Kasparov).

The chess games of Vladimir Kramnik

Vladimir Kramnik defeated Garry Kasparov in 2000, and then after much controversy became the undisputed world champion by beating Topalov in World Chess Championship 2006 reunification match, late 2006. This match, and all subsequent championships, have been administered by FIDE.

i022Viswanathan_Anand_(2016)   i022 Viswanathan_Anand_(2016) (2007–2013) 

The chess games of Viswanathan Anand

Viswanathan Anand, famed for his ultra-rapid play, Indian, held the FIDE title from 2000 to 2002, and the unified title from 2007 to 2013.Kramnik played to defend his title at the World Chess Championship 2007 in Mexico. This was an 8-player double round robin tournament, the same format as was used for the FIDE World Chess Championship 2005. This tournament was won by Viswanathan Anand, thus making him the World Chess Champion. Because Anand’s World Chess Champion title was won in a tournament rather than a match, a minority of commentators questioned the validity of his title.[61] Kramnik also
made ambiguous comments about the value of Anand’s title, but did not claim the
title himself.[62] Subsequent world championship matches returned to the format
of a match between the champion and a challenger.The following two championships had special clauses arising from the 2006
unification. Kramnik was given the right to challenge for the title he lost in a
tournament in the World Chess Championship 2008, which Anand won. Then Topalov,
who as the loser of the 2006 match was excluded from the 2007 championship, was
seeded directly into the Candidates final of the World Chess Championship 2010.
He won the Candidates (against Gata Kamsky). Anand again won the championship
match.[63][64]The next championship, the World Chess Championship 2012, had short knock-out
matches for the Candidates Tournament. This format was not popular with
everyone, and world No. 1 Magnus Carlsen withdrew in protest. Boris Gelfand won
the Candidates. Anand won the championship match again, in tie breaking rapid
games, for his fourth consecutive world championship win.[65]

i031Alexander_Khalifmani031 i031Alexander_Khalifman

Split title (1993–2005)

Alexander Khalifman, FIDE World Champion 1999-2000.
Ruslan Ponomariov, FIDE World Champion 2002-2004.
Rustam Kasimdzhanov, FIDE World Champion 2004-2005.
Veselin Topalov, FIDE World Champion 2005-2006.
Reunified title (2006)

1993, Nigel Short broke the domination of Kasparov and Karpov by defeating
Karpov
in the candidates semi-finals followed by Jan Timman in the finals,
thereby earning the right to challenge Kasparov for the title.

However, before
the match took place, both Kasparov and Short complained of corruption and a
lack of professionalism within FIDE
in organizing the match, and
split from FIDE to set up
the Professional Chess Association PCA, under whose auspices they
held their match. In response, FIDE stripped Kasparov of his title and held a
championship match between Karpov and Timman. Kasparov defeated Short while
Karpov beat Timman, and for the first time in history there were two World Chess
Champions
.

FIDE and the PCA each held a championship cycle in 1993–1996, with many of the
same challengers playing in both. Kasparov and Karpov both won their respective
cycles. In the PCA cycle, Kasparov defeated Viswanathan Anand in the PCA World
Chess Championship 1995. Karpov defeated Gata Kamsky in the final of the FIDE
World Chess Championship 1996. Negotiations were held for a reunification match
between Kasparov and Karpov in 1996–97,[59] but nothing came of them.[60]

Soon after the 1995 championship, the PCA folded, and Kasparov had no
organisation to choose his next challenger. In 1998 he formed the World Chess
Council, which organised a candidates match between Alexei Shirov and Vladimir
Kramnik. Shirov won the match, but negotiations for a Kasparov–Shirov match
broke down, and Shirov was subsequently omitted from negotiations, much to his
disgust. Plans for a 1999 or 2000 Kasparov–Anand match also broke down, and
Kasparov organised a match with Kramnik in late 2000. In a major upset, Kramnik
won the match with two wins, thirteen draws, and no losses. At the time the
championship was called the Braingames World Chess Championship, but Kramnik
later referred to himself as the Classical World Chess Champion.

Meanwhile, FIDE had decided to scrap the Interzonal and Candidates system,
instead having a large knockout event in which a large number of players
contested short matches against each other over just a few weeks (see FIDE World
Chess Championship 1998). Rapid and blitz games were used to resolve ties at the
end of each round, a format which some felt did not necessarily recognize the
highest quality play: Kasparov refused to participate in these events, as did
Kramnik after he won the Classical title in 2000. In the first of these events
in 1998, champion Karpov was seeded straight into the final, but subsequently
the champion had to qualify like other players. Karpov defended his title in the
first of these championships in 1998, but resigned his title in protest at the
new rules in 1999. Alexander Khalifman won the FIDE World Championship in 1999,
Anand in 2000, Ruslan Ponomariov in 2002, and Rustam Kasimdzhanov in 2004.

By 2002, not only were there two rival champions, but Kasparov’s strong results
– he had the top Elo rating in the world and had won a string of major
tournaments after losing his title in 2000 – ensured even more confusion over
who was World Champion. In May 2002, American grandmaster Yasser Seirawan led
the organisation of the so-called “Prague Agreement” to reunite the world
championship. Kramnik had organised a candidates tournament (won later in 2002
by Peter Leko) to choose his challenger. It was decided that Kasparov play the
FIDE champion (Ponomariov) for the FIDE title, and the winner of this match play
the winner of the Kramnik–Leko match for a unified title. However, the matches
proved difficult to finance and organise. The Kramnik–Leko match did not take
place until late 2004 (it was drawn, so Kramnik retained his title). Meanwhile,
FIDE never managed to organise a Kasparov match, either with 2002 FIDE champion
Ponomariov, or 2004 FIDE champion Kasimdzhanov. Partly due to his frustration at
the situation, Kasparov retired from chess in 2005, still ranked No. 1 in the
world.

Soon after, FIDE dropped the short knockout format for a World Championship and
announced the FIDE World Chess Championship 2005, a double round robin
tournament to be held in San Luis, Argentina between eight of the leading
players in the world. However Kramnik insisted that his title be decided in a
match, and declined to participate. The tournament was convincingly won by the
Bulgarian Veselin Topalov, and negotiations began for a Kramnik–Topalov match to
unify the title.

i032RPonomariovi032 i032 Ponomariov
i033Kasimdhzanov_Torino_2006i033 i033 Kasimdhzanov_Torino_2006
i034Veselin_Topalov_2013i034 i034
Bulgarian
Veselin_Topalov_2013

Memory and Chess


http://www.chessmaniac.com/memory-and-chess/

Emanuel Lasker stated that anyone this side of an imbecile could become a
master.

In 1894, Alfred Binet conducted one of the first psychological studies
into chess. He found that only chess masters were able to play chess
successfully without seeing the board. In 1927, Soviet psychologists conducted
extensive tests on top chess masters and came to the conclusion that their
powers of memory were only greater than that of the layman as far as chess was
concerned; in other areas of memory, there was no discernible superiority of a
chess master and a layman. In the 1940s, Edward Lasker wrote on an organized
study that was made of a dozen leading chess masters by a group of
psychologists. It was found that a chess master’s memory was only exceptional
where positions on the chessboard were concerned.  In 1965, Adrian de Groot
(1914-2006) published his book “Thought and Choice in Chess”. He found that
visual memory and visual perception were important attributes and that
problem-solving ability was of paramount importance. Memory was particularly
important.

In 1973, William Chase (1940-1983) and Herbert Simon (1916-2001) showed
superior memory for chess positions by chess experts through “chunking”. A chunk
is a pattern or a collection of elements that are strongly associated with one
another, but are weakly associated with elements in other chunks. Chunking the
numbers becomes 1492 10000 64 or when Columbus sailed to America,  zip code
of Zagreb and the number of squares on a chessboard. For chess, a chunk might be
a king-side castling position Kg1, Rf1, Pf2, Pg2, Ph2, Nf3 6 chessmen on 6 out
of 64 squares. Another example is the opening position out of a Ruy Lopez or
Sicilian, Najdorf.

If you had a random position of a bunch of chessmen, a chess player would not
have any more advantage than a non-chess player in recreating the position.

You store chunks in long-term memory (LTM), but you process them through
short-term memory (STM). Adults are able to store 3-7 chunks in short-term or
working memory at any one time in about one minute. If all you can store is 3
chunks, then to visualize the entire chess board and hold it in working memory,
you need to see the entire position in only 3 chunks at most. Therefore, chunks
need to be quite large. You may be able to work with three chunks at any one
time and process information rapidly between your short term memory and your
long term memory in order to visualize the entire board.

In 1987-88, all students in a rural Pennsylvania 6th grade class were
required to participate in chess lessons. None of the pupils had previously
played chess. After a year, the pupils significantly improved in both memory and
verbal reasoning. The program was called ‘Development of Reasoning and Memory
through Chess.’

In 2001, researchers wrote in Nature magazine that a chess grandmaster
studies and practices for at least 10 years to learn more than 100,000 chess
patterns (memory chunks). Consequently, GMs can ‘recognize’ they key elements in
a problem situation much more rapidly than amateurs.

Alekhine had a photographic memory (also known as eidetic memory) as a boy.
In 1925, Alexander Alekhine was given a few standard memory tests. They revealed
that if a test had nothing to do with chess, such as memorizing words, shapes,
or objects, he did no better than an average person. On the other hand, when a
test involved memory of a chess position placed on a board in front of him, he
performed exceptionally well. Several articles have been written on Alekhine
stating that he was able to remember all the master chess games during the last
25-30 years.

Vishy Anand’s mother says that he has always had a photographic memory. He
said the first skill needed is to develop memory hooks. Thanks to all these
hooks, it is easy to remember these games years later  :

  1. You learn a few mates and a few tricks
  2. Then you slowly progress, seeing the games of the great players, classic
    examples that every chess player must know. The  great player explains his
    game, and the key moments
  3. A lot of games are accompanied with diagrams of key positions where
    something interesting happened

Blackburne had a good memory and could memorize large lists of information
and recalled a large number of chess games played by masters. When author
Anderson Graham was looking over some of Blackburne’s chess games with him in
the late 1890s, he was astounded to find that Blackburne could recall chess
games he had not seen for 30 or more years.

Capablanca said he had a photographic memory as a child. He could read seven
pages of history and recite them verbatim. As he got older, Capablanca said he
could hardly remember any of his games he played in the past, but had met
experts who remembered every one of his serious games in the last 22 years.

Magnus Carlsen, in an interview on 60 Minutes, said that he has memorized
10,000 chess games. When he was 2 year old, he was able to recite all the major
car brands of Norway. At age 5, he memorized all the world’s countries, their
flags, and their capitals. He was asked if he had a great memory with other
things other than chess. Carlsen responded, “No, I forget all kinds of stuff. I
mean, I’m pretty good at remembering names, but I can never remember faces. I
regularly lose my credit cards, my mobile phone, keys and so on.”

Bobby Fischer’s memory for chess was pretty good. At the conclusion of the
unofficial Blitz Championship of the World at Hercegnovi, Yugoslavia, in 1970,
Fischer rattled off the scores of all his twenty-two games, involving more than
1,000 moves, from memory. And just prior to his historic match with Taimanov, in
Vancouver, British Columbia, Fischer met the Russian player Vasiukov and showed
him a speed game that the two had played in Moscow fifteen years before. Fischer
recalled the game move by move. Gudmundur Thorarinsson, the organizer of the
1972 world championship match between Fischer and Spassky, recounts a story of
Bobby phoning Icelandic grandmaster Fridrik Olafsson to ask for some technical
advice ahead of the match in 1972. The phone was answered by the Olafsson’s
10-year-old daughter who spouted several sentences of Icelandic that baffled
Fischer. The next day Fischer, who spoke no Icelandic, repeated those sentences
exactly to Thorarinsson, every phrase, every inflection accurate, so that
Thorarinsson could understand precisely what the young girl had said.
Thorarinsson called it a “phonetic memory.”

Garry Kasparov says that he was able to remember all the master games he has
played. In 1987-88, the German magazine Der Spiegel went to considerable effort
and expense to find out Kasparov’s IQ and test his memory. Under the supervision
of an international team of psychologists, Kasparov was given a large battery of
tests designed to measure his memory, spatial ability, and abstract reasoning.
They measured his IQ as 135 and his memory as one of the very best. Kasparov was
asked if he had to re-evaluate the positions on each board every time he had
returned to make a move in a simul, or if he remembered the positions all the
time. Kasparov replied that he in fact remembered all the positions. He also
said he could recall the moves of all the games he had played in the past 6
months.

George Koltanowski had a powerful memory that allowed him to play a large
number of blindfold games simultaneously. He claimed he had a “phonographic
memory” (a keen memory for sequences) that allowed him to do a blindfold
knight’s tour. In the early 1980s, George Koltanowski conducted a blindfold
knight’s tour at the Dayton Chess Club, where I (ChessManiac) was President. A
month later, I wrote a letter to George, and, in fun, asked him what was on c4.
When he got the letter, he phoned me up and was able to recall what was on all
the chess squares (c4 was my name). One time at his apartment, I asked George
Koltanowski’s wife, Leah, if George had a good memory about anything else. She
replied, “George can go to the supermarket and forget his loaf of bread.”

Boris Kostic had a good memory and could recall a large number of master
games.
Irina Krush says she knows people that remember hundreds of games,
but she says she does not have that talent. She says that she remembers her
games from a tournament, but will forget them in a few days. She only remembers
a general shape, a pattern of every game, but not the details.

Emanuel Lasker wrote this about memory. “Chess must not be memorized, simply
because it is not important enough. If you load your memory, you should know
why. Memory is too valuable to be stocked with trifles. Of my fifty-seven years
I have applied at least thirty to forgetting what I had learned or read, and
since I succeeded in this I have acquired a certain ease and cheer which I
should never again like to be without. If need be, I can increase my skill in
Chess, if need be I can do that of which I have no idea at present. I have
stored little in my memory, but I can apply that little, and it is of good use
in many and varied emergencies. I keep it in order, but resist every attempt to
increase its dead weight.”

Frank Marshall had a good memory. In January 1922, Frank Marshall played 155
opponents on Montreal. He won 126, lost 8, and drew 21 (88%) after 7 hours of
play. A week later, he was able to replay 153 of 155 games from memory. What
bothered him was forgetting the other two games. He thought he was losing his
memory.

Many articles about Paul Morphy report that he was able to recite from memory
nearly the entire Civil Code of Louisiana (3,500 articles).

Armenian International Master Ashot Nadanian once mentioned that he can
easily recall chess games some 20 years ago, but cannot remember his mobile
phone number

Miguel Najdorf possessed a strong chess memory. He was able to play a large
number of blindfold simultaneous games.

When Philidor played two blindfold games at once in 1783, it was written up
as one of the greatest memory skills ever displayed. A newspaper wrote, “This
brief article is the record of more than sport and fashion: it is a phenomenon
in the history of man so should be hoarded among the best samples of human
memory, till memory shall be no more.

Harry Nelson Pillsbury had a good memory, being able to play
15 games of chess and 15 games of checkers at the same time, blindfolded, while
also playing cards and memorizing a list of complicated words. His obituary in
the New York Times stated that he died from an “illness contracted through
overexertion (overeffort) of his memory cells.” He actually died of syphilis.

Grandmaster Lev Psakhis was able to remember every one of Bobby Fischer’s
games by heart. In 1973, Grandmaster Salo Flohr brought some Chess Informants
with him during a simultaneous exhibition in Krasnoyarsk, USSR. 14-year-old
Psakhis astounded Flohr by telling him in each diagram who the players were.
Psakhis had memorized every diagram in the book. Psakhis was asked if he was a
prodigy (gifted or intelligent (young) person, sign of something about to
happen, example of a particular quality). Psakhis replied, “No, I just have a
good memory,”

Richard Reti had a strong chess memory, but in other areas, his memory wasn’t
so good. In 1925 Reti played 29 opponents blindfold simultaneously in Sao Paulo
and was able to recall all the games. After the exhibition, he was going home
and forgot his suitcase. When somebody reminded him about it, Reti said, “Thank
you very much. My memory is so bad…”

Akiba Rubinstein was said to know every chess game he played by heart, though
unsubstantiated (Unsupported by other evidence).

Bernard Zukerman has a very good chess memory, which made him one of the
outstanding openings expert.

12. PHP menu & CRUD code skeleton (B12phpfw) comparison

Featured

Revised November 2021 October 2020, December 2019. Original post was published in February 2019.
Download https://github.com/slavkoss/fwphp/ . My articles before this are not needed to learn B12phpfw.

November 2021 version 8.0.0 (requires PHP ver. >= 7). Download  contained many learning examples, but no more because three modules – packages :  Mnu (menu code skeleton), Msg (Blog – compound module) and Mkd  contain enough (not to simple)  PHP code for learning, create large sites CRUD pages and own WYSIWYG web editor. To simple learning code (frequent in learning sources books and internet) is dangerous, leads to wrong coding, which is one of reasons why I have 8 versions. Version 8 is in my opinion smallest code to learn serious web programing.

What’s new in version 8 :

  1. Autoload.php is refactored, much simpler, see old z_NOT_USED_TO_COMPLICATED_Autoload_1stVersion.php
    This is good case showing that first code versions are to complicated code – very frequent case – which is one of reasons why I have 8 versions.
  2. Shares are not any more in \zinc folder but in in vendor folder eg \vendor\b12phpfw\Autoload.php (below web server doc root eg J:\awww\www\). Site roots are on same place in folders hierarchy eg \fwphp (may be named site_x). Also group of modules eg \fwphp\glomodul. Also modules eg \fwphp\glomodul\blog – dir like oracle Forms form module.
  3. PHP 8 (ver. 7 still works) and Bootsrap 5
<?php
http://dev1:8083/fwphp/www/
// J:\awww\www\fwphp\www\index.php
namespace B12phpfw\site_home\www ;

use B12phpfw\core\b12phpfw\Autoload ;

//1. settings - properties - assign global variables to use them in any code part
$module_path = str_replace('\\','/', __DIR__) .'/' ;
$site_path = dirname($module_path) .'/' ; //to app dir eg "glomodul" dir and app
//to web server doc root or our doc root by ISP $module_towsroot = eg '../../../'
$wsroot_path = dirname(dirname($module_path)) .'/' ;
//or $wsroot_path = str_replace('\\','/', realpath('../../')) .'/' ;
$shares_path = $wsroot_path.'vendor/b12phpfw/' ; //includes, globals, commons, reusables

$pp1 = (object)
[ 'dbg'=>'1', 'stack_trace'=>[str_replace('\\','/', __FILE__ ).', lin='.__LINE__]
, 'module_version'=>'8.0.0.0 Mnu' //, 'vendor_namesp_prefix'=>'B12phpfw'
// $_SESSION["TrackingURL"]=$_SERVER["PHP_SELF"];
// 1p. (Upper) Dirs of clsScriptsToAutoload. With 2p(ath). makes clsScriptToAutoloadPath
// 2p. Dir name of clsScriptToAutoload is last in namespace and use (not full path !).
, 'wsroot_path' => $wsroot_path // to awww/www (or any names)
, 'shares_path' => $shares_path // to b12phpfw, b12phpfw is required dir name
, 'site_path' => $site_path // to fwphp (or any names)
, 'module_path' => $module_path // to fwphp/www (or any names)
//
, 'glomodul_path' => $site_path .'glomodul/'
, 'examples_path' => $site_path .'glomodul/z_examples/'
] ;

//2. global cls loads classes scripts automatically
require($pp1->shares_path . 'Autoload.php');
new Autoload($pp1);

//3. process request from ibrowser & send response to ibrowser :
//Home_ ctr "inherits" index.php ee inherits $p p 1
$module = new Home_ctr($pp1) ; //also instatiates higher cls : Config_ allsites

exit(0);
<?php
// J:\awww\www\vendor\b12phpfw\Autoload.php
namespace B12phpfw\core\b12phpfw ; //Dir name is last in namespace and use 
//use B12phpfw\dbadapter\post\Tbl_crud ; // as Tbl_crud_post ;

class Autoload
{
protected $pp1 ; //M O D U L E PROPERTIES PALLETE like in Oracle Forms

public function __construct(object &$pp1) {
$pp1->stack_trace[]=str_replace('\\','/', __FILE__ ).', lin='.__LINE__ .' ('. __METHOD__ .')';
$this->pp1 = $pp1 ;
spl_autoload_register(array($this, 'autoloader'));
return null ;
}

function autoloader(string $nscls) 
{
//$nscls is namespaced called cls name eg B12phpfw\module\book\Home_ctr
$DS = DIRECTORY_SEPARATOR ;
$nscls_linfmt = str_replace('\\',$DS, $nscls) ; //ON LINUX
$clsname = basename($nscls_linfmt) ; //eg Home_ctr, Config_ allsites, Db_allsites
$module_dir = basename(dirname($nscls_linfmt)) ; //eg Home_ctr, Config_ allsites, Db_allsites
//echo '<pre>$nscls='; print($nscls) ; echo ' $module_dir='; print($module_dir) ; echo '</pre>';

switch ($module_dir) {
case 'b12phpfw': 
$clsscript_path=dirname($this->pp1->shares_path).'/'.$module_dir.'/'.$clsname .'.php' ; 
break;
default:
$clsscript_path=dirname($this->pp1->module_path).'/'.$module_dir.'/'.$clsname .'.php' ; break;
break; 
}
//echo '<p>$clsscript_path='; print($clsscript_path) ; echo ' SAYS: '. __METHOD__ .'</p>';

require $clsscript_path;


}
}

2020.09.30 DONE version 7.0.0 (declare(strict_types=1);).

DBI is improved with trait Db_allsites instead class Db_allsites. Each DB (persistent storage) adapter-class named Tbl_crud :

  1. use B12phpfw\core\zinc\Db_allsites
  2. implements Interf_Tbl_crud

This means that :

  1. eg blog module in blog folder, works much easier with more model classes ee Tbl_crud -s, ee with own Tbl_crud and with other tables Tbl_crud.
  2. eg sole module controller class Home_ctr extends class Config_allsites, no more extends also two DB CRUD classes which is unnatural (but seems easy because logically : all is in Home_ctr).

B12phpfw core (CRUD) code – How to get ONLY banana ?

It is not easy to see need to why convert code from procedural MVC to OOP MVC with namespaces and autoloading. For navigation (url-s, links) code procedural and OOP is same – OOP does not help. Procedural MVC user module code is more clear and readable. So why is OOP better ?

Some say: “is OOP mistake ?” – eg lack of reusability in OOP – to get banana (some method or attribute) you get also gorilla holding banana and whole gorilla`s jungle (all higher classes with complicated dependencies). It is why B12phpfw code skeleton is for CRUD modules (is not required for Mnu and Mkd modules but I put both on B12phpfw code skeleton).

Interfaces help to get ONLY banana, but coding is complicated – I could find only strong-talk-weak-work code examples about advanced use of interfaces.

  1. My not complicated interface Interf_Tbl_crud I made to standardize coding Tbl_crud model adapter classes and Db_allsites shared model class. Each simple (ee one table) module like “invoice items” module has own dir and own Tbl_crud class leading to more than 100 Tbl_crud.php model adapter classes scripts in big application (eg material and financial book keeping).
    J:\awww\www\vendor\b12phpfw\Interf_Tbl_crud.php (... hits)
    Line 20: static public function get_cursor( //instead rr
    Line 28: static public function cc(object $pp1, array $other=[]): object ; //create row
    Line 31: static public function rrnext(object $cursor ): object ; //read next from $c=get_cursor
    Line 34: static public function rrcnt( //string $sellst, //read count rows in table
    ...
  2. With DBI trait Db_allsites I eliminated two higher DB classes. So if banana (some method or attribute) is get_cursor (read) from more tables it is not in two higher DB classes which seems simplest solution but caused complicated coding in version 6. Eg invoice module works with two (or three – bill) tables : invoice and invoice_items.get_cursor banana is not in jungle (two higher DB classes) any more, gorilla and jungle is only one abstract class Config_allsites which is de facto assigning $pp1 = properties (Oracle Forms form property palete made global).
    1. Banana $pp1 = properties palette may cause difficulties in aggregate (compound, composed, multiplex) modules like Blog, Invoice… but $pp1 is inevitably (imminence, necessity) gorilla-jungle and can not be further simplified. I worked 20 years with $pp1 and globals jungle (Oracle Forms 6i) which i not so well accomplished as in B12phpfw .

    See https://phpthewrongway.com/, or Joe Armstrong why OOP sucks http://harmful.cat-v.org/software/OO_programming/why_oo_sucks.

    Similar “simplest solution” three dirs M,V,C is (I think) bad, I have opinion -:) for 3dirs lovers who put in foreground coding technic (M,V,C code separation) instead pages (functionality, business logic , eg invoice page).

During winter 2019/2020 year (much to late because I tested lot what others did) I made Version 6. of menu and CRUD PHP code skeleton (own framework named “B12phpfw”) – core code is about 50 kB.
I also made posts module “Msg” with posts edited with WYSIWYG Markdown SimpleMDE editor (or HTML WYSIWYG Sumernote editor or … any editor you wish). Msg module is based on B12phpfw, also very small code.

B12phpfw code skeleton and Msg application on B12phpfw skeleton is minimal PHP code to learn (medium/advanced knowlege) PHP !

Why ?

  1. I do not like proposed solutions in best php frameworks (Laravel, Simfony, Yii…) and learning sources (internet, books).
  2. I think that eg module invoice php code should be in own folder like Oracle Forms form invoice.fmb instead all forms/reports in 3 folders: M, V, C).
  3. I think that should be simple/fast/professional : shares (globals), routing, dispaching, classes loading , web rich text editing – it is why I spend many hours coding my B12phpfw (huge time wasting which should do software authors, not sw users-programers like me).

Compared B12phpfw Msg (blog) module and TraversyMVC blog module and Mini3 module URLs Youtube songs adresses

Why I do not like proposed solutions in existing PHP frameworks and what I did to (I hope) improve fw code. Red colored features and three asterisks *** are main reasons for B12phpfw, but I improved also other features.

TraversyMVC (has video) and Mini3 are simplified, with some (many?) differences Laravel, Simfony, Yii… B12phpfw is much more different – see red colored features.

Feature B12phpfw TraversyMVC and Mini3
1. ***Modules in own folder like Oracle Forms .fmb has – it is main reason for B12phpfw ! has not like Mini3 – all forms/reports in 3 folders: M, V, C
2. Name spaced classes (functional name spacing) has has not – no functional, no positional (paths) name spacing, Mini3 MVC PHP fw which is in my opinion better than TraversyMVC : https://github.com/panique/mini3 has name spaced classes
3. Number of folders (my opinion) optimal to many like Mini3
4. Minimal PHP code to learn (medium) PHP (my opinion) optimal (but we could add additional code) good but not enough like Mini3 eg see WYSIWYG, globals…
5. Functional methods, attr. etc naming (my opinion) good could be better
6. ***Global classes, methods etc (my opinion) good bad like Mini3
7. (Posts edited with any) WYSIWYG editor has has not like Mini3
8. ***Home_ctr or Home_mdl CRUD layer methods do not know for underlaying Db_allsites layer PDO methods, MySql, Oracle… has much improved has not like Mini3
9. OOP has has like Mini3
10. namespaces (own PSR-4 (or Composer’s) autoloading classes scripts) improved has not, Mini3 has
11. ***All scripts are included (ee no http jumps except some jumps to other module) has has not, Mini3 has, B12phpfw took it from Mini3
12. jQuery only for Bootstrap 5 yes yes, Mini3 has own CSS
13. no AJAX, no JSON yes yes, Mini3 has basic jQuery AJAX explained
14. server side validation has has like Mini3
15. authentification (log in / out) has has, Mini3 has not
16. authorization (only logged in users may execute some code ee CRUD code…) has has, Mini3 has not
17. ***Own debugging very simple and useful : msg in pre tag or popup JS msg). xdebug also helps. has has not like Mini3

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)

how:

  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.

 

PREREQUISITES FOR PHP WEB DEVELOPMENT

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

ORACLE 11g PDO & OCI8 EXTENSION – OPTIONAL

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

4. COMPOSER DEPENDENCY MANAGER FOR PHP (CODE DOWNLOADER)

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)

5. GIT MULTIUSER SCRIPTS SYNCHRONIZER see Git book

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

1c. Web server at home, DDNS (dynamic DNS), access my dyndns from local network, PHP, CURL, OpenSSL

HOME

DDNS – Dynamic DNS

Access my dyndns from local network ee access my dynamic DNS domain name inside my LAN.

I dont want to redirect from Dyn hostname to 192.168.x.x (create an entry in my hosts file with Dyn hostname and the LAN IP), but how i can access from inside network to my dyndns ?

Solution below would be better without (see below) localtest.me or fuf.me but I do not know how to do it.

I did not used this (not clear explanations):
Few home routers support what’s known as NAT Reflection or Loopback, see http://opensimulator.org/wiki/NAT_Loopback_Routers. NAT loopback connection basically is accessing a LAN side device via it’s NAT’ed WAN IP from the internal LAN network.
Setting up Microsoft Loopback adapter allows you to have multiple service appear at the same port.

WORKS My home site from local network :

http://phporacle.mooo.com.localtest.me:8083/

http://phporacle.mooo.com.fuf.me:8083/

WORKS  My home site from inet is without (see below) localtest.me or fuf.me :

http://phporacle.mooo.com:8083/

 

How I did it :

11111 Open port in router and firewall

On Windows XP PC (different router) subdomains like fuf.me or localtest.me are not needed,
but on Win 8.1 and 10 router Siemens Gigaset SX763 WLAN dsl  are now needed (few monts ago not !!).

1. open port 8083 or simmilar in router – port 8083 forward to my PC static IP 192.168.x.x (ipv4 network adapter properties !)
2. open port 8083 in Windows firewall for TCP access (UDP also ?)
2.1 WINKEY+R -> type WF.msc
2.2 In the Windows Firewall with Advanced Security, in the left pane,
left-click Inbound Rules -> click New Rule in the action pane.
2.3 In the Rule Type dialog box, select Port, and then click Next…

ZWAMP does next in Windows firewall :
httpd.exe      J:\zwamp64\vdrive\.sys\Apache2\bin\httpd.exe
mysqld.exe   J:\zwamp64\vdrive\.sys\mysql\bin\mysqld.exe

My C:\Windows\System32\drivers\etc\hosts
127.0.0.1      localhost dev1
::1                 localhost dev1

22222 What Is My IP? see code at end of this page

The request came from:
fe80::8179:3afd:d500:28f5

My home web server IP : 89.164.194.29

or
http://www.canyouseeme.org/

https://www.whatismyip.com/

http://www.portchecktool.com/

http://www.yougetsignal.com/tools/open-ports/

https://bestvpn.org/whats-my-ip/

https://www.dynu.com/networktools/portcheck

33333 Send my IP to DDNS provider

DDNS client

or

http://YOURDDNSUSRNAME:YOURDDNS[email protected]/nic/update?hostname=phporacle.mooo.com&myip=89.164.194.29

or

rem J:\zwamp64\vdrive\web\utl\wcurl_phporacle.mooo.com.bat
@cls
cd %~DP0
@echo Updating FreeDNS
@J:\CURL\CURL -k http://freedns.afraid.org/dynamic/update.php?RFFqMGxON2s5V1RXSm51VE84bkJjamdIOjE3MDE3ODUw
@pause

or

rem J:\zwamp64\vdrive\web\utl\wget_phporacle.mooo.com.bat
cd %~DP0
J:\CURL\wget -q –read-timeout=0.0 –waitretry=5 –tries=400 –background http://freedns.afraid.org/dynamic/update.php?RFFqMGxON2s5V1RXSm51VE84bkJjamdIOjE3MDE3ODUw

 

 

Public DNS Pointing To localhost (127.0.0.1)

http://www.fidian.com/programming/public-dns-pointing-to-localhost

Hosts File

The first and easiest method is where one edits their hosts file (/etc/hosts in Linux,  C:\Windows\System32\Drivers\etc\hosts for some versions of Windows) and add lines like this:
127.0.0.1 client1.local
127.0.0.1 client2.dev
127.0.0.1 client3
At work, we have up to five different hostnames for each of our clients.  Adding yet another client means dozens of developers that now need to edit their hosts file.  Oh, the pain and agony when you have to do this for hundreds of domains!
What if we could have a single top-level domain that always resolved to localhost?

 

DNS Entries – Windows

If you are using Windows DNS, you can create a new zone (I did not):
dnscmd /RecordAdd local * 3600 A 127.0.0.1
dnscmd /RecordAdd local @ 3600 A 127.0.0.1

dnsmasq – Linux, MacOS

On Linux systems, you can install dnsmasq to pretend to be a real DNS server and actually respond with 127.0.0.1 for all subdomains of a top level domain.  So, if you wanted *.local to always resolve to your own domain, then you can use URLs like this:
http://client1.local/
http://client2.local/
http://client3.local/
You only need to install and set up dnsmasq.  There’s some well-written instructions at http://drhevans.com/blog/posts/106-wildcard-subdomains-of-localhost that you can follow; I won’t repeat them here.
The drawback of this setup is that you now have to install and configure dnsmasq on every machine where you want to use this trick.
What if someone set up DNS entries and basically did this for you?

Available Wildcarded DNS Domains

Some kind hearted people already set up wildcarded domains for you already.  You can use any top level domain below and any subdomain of these and they will always resolve back to 127.0.0.1 (your local machine).

http://localtest.me:8083/   or  http://fuf.me:8083/    – WORKS same as http://localthost:8083/
or same for:    2011 –  September 2017:

  1. http://fuf.me:8083/ – Managed by me; it will always point to localhost for IPv4 and IPv6
  2. http://localtest.me:8083/ – Also has an SSL cert
  3. http://127-0-0-1.org.uk:8083/
  4. http://42foo.com:8083/
  5. http://vcap.me:8083/
  6. http://beweb.com:8083/
  7. http://yoogle.com:8083/
  8. http://lvh.me:8083/
  9. http://ulh.us:8083/
    no more http://ortkut.com:8083/              http://feacebook.com:8083/
    http://ratchetlocal.com:8083/     http://smackaho.st:8083/
Now, with these wildcarded domains, you don’t need to do any modification of your system for requests to come back to your own server.  For instance, you can go to http://127-0-0-1.org.uk:8083/ and the web page request will always head back to your own server.  You’ll still need to configure your web server to answer on this hostname as above said, but at least the DNS portion of the problem is now solved.

 

 

Install  cURL (SSL-enabled) Win command-line tool

 

If you install Git for Windows you get Curl automatically too. There are some advantages:

  • Git takes care of the PATH setup during installation automatically.
  • You get the GNU bash, a really powerful shell, in my opinion much better than the native Windows console.
  • You get many other useful Linux tools like tail, cat, grep, gzip, pdftotext, less, sort, tar, vim and even Perl.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/13_2/messagingservice/files/installing_curl_command_line_tool_on_windows.html

This tutorial shows you how to access Oracle Messaging Cloud Service via the REST interface by using the cURL command-line tool. cURL is free, open software that runs under various operating systems.

This tutorial demonstrates cURL on a Windows 64-bit operating system that is enabled for the secure sockets layer (SSL). The authentication aspects of the Messaging Cloud Service require an SSL-enabled environment.

Your first task is to install the appropriate version of cURL for your SSL-enabled environment.

There is an ordered series of steps to follow to install cURL on Windows. There are two libraries to install and they must be installed before cURL will work with SSL. Also, they must be installed in this order to work. Do not skip the step to install a recent certificate.

Install Visual C++ 2008 Redistributable Package.

For 64-bit systems: Visual C++ 2008 Redistributables (x64) from http://www.microsoft.com/en-us/download/details.aspx?id=15336

For 32-bit systems: Visual C++ 2008 Redistributables (x32)

Install Visual C++ 2010 Redistributable Package.

For 64-bit systems: Visual C++ 2010 Redistributables (x64) from http://www.microsoft.com/en-us/download/details.aspx?id=14632

For 32-bit systems: Visual C++ 2010 Redistributables (x32)

Install Win(32/64) OpenSSL v1.0.0k Light from http://www.shininglightpro.com/products/Win32OpenSSL.html.

For 64-bit systems: Win64 OpenSSL v1.0.0k Light

For 32-bit systems: Win32 OpenSSL v1.0.0k Light

In your browser, navigate to the cURL welcome page at http://curl.haxx.se and click Download.

On the cURL Releases and Downloads page, click the link for the SSL-enabled version for your computer’s operating system, download the zip file, and install it in a new folder on your computer.

The cURL website offers a wizard to find the appropriate version for your computer’s operating system.

For this tutorial, the 64-bit generic, SSL-enabled version for Windows is selected.
Copy curl.exe file into your Windows PATH folder. By default, this is C:\Windows\System32

Install recent CA Certificates. Do not skip this step.
Download cacert.pem, a recent copy of valid CERT files, from http://curl.haxx.se/docs/caextract.html.
Copy it to the same folder where you placed curl.exe and rename it curl-ca-bundle.crt.
Or: Move this file into your Windows PATH folder.

Invoke curl.exe from a command window (in Windows, click Start > Run and then enter “cmd” in the Run dialog box).

You can enter curl --help to see a list of cURL commands.

http://freedns.afraid.org/dynamic/

DDNS record types

Type: A – Point subdomain.domain.com (phporacle.mooo.com) to a hard coded IP Address. Most direct and straight forward option, also note any change you make in the FreeDNS program is reflected on the internet and made live immediately. The only way you will not see immediate results is if you have cached a query on your computer by looking it up PRIOR to configuring it in the FreeDNS program.

Type: MX – Point subdomain.domain.com to a mail server. These type of records are special for just mail servers, they can co-exist with A records, and their only use is for routing mail to a different location. All mail implementations check for this record first before attempting to route an e-mail message. If a MX record does not exist for a host, an e-mail delivery would be attempted directly to the IP that the hostname resolves to.

Type: AAAA – Point subdomain.domain.com to a IPv6 address. Useful for those who are using IPv6 on their personal networks or those who are using a IPv4 to IPv6 tunnel at home.

Type: CNAME – Point subdomain.domain.com to another hostname. Good for those who are using other dynamic DNS services. You can create a CNAME record to another host and whatever subdomain.domain.com you choose here will go to whatever IP address the CNAMEd host has.

Type: NS – Point subdomain.domain.com to another NAMESERVER. If you choose this option, then whatever subdomain.domain.com address you choose using FreeDNS will have to be configured and setup on the destination ADDRESS (nameserver) that you choose. This option basically means you are delegating a FreeDNS host to another DNS server all together, so when you choose this option you are telling every computer on the internet to ask the ‘address’ where subdomain.domain.com is located at. If the host you point an NS record to is not configured to answer for the subdomain.domain.com that you are using in FreeDNS then the subdomain.domain.com host will not resolve.

Type: TXT – Lets you create TXT records, used for a number of different things, most commonly for DKIM records (for combatting spam) so other receiving mail servers can verify email was sent from you by verifying your publically published crypto-signature. Wrap your TXT “destination” in quotes (don’t worry, the system will remind you if you forget).

Type: SPF – A anti-spam record, good to have on any domain you’re sending email with. See https://www.spfwizard.net/ for more details.

Type: LOC – A means for Expressing Location Information in the Domain Name System.

RFC1876 has the complete explanation.

To find your latitude/longitude location, you may find Map-O-Rama of use.

Type: RP – The Responsible Person RR. RP has the following format:

RP <mbox-dname> <txt-dname>

Both RDATA fields are required in all RP RRs.

The first field, <mbox-dname>, is a domain name that specifies the mailbox for the responsible person.

The second field, <txt-dname>, is a domain name for which TXT RR’s exist. A subsequent query can be performed to retrieve the associated TXT resource records at .

RFC1183 has the complete explanation.

Type: SRV – A ‘service’ record, used by Session Initiation Protocol (SIP), and the Extensible Messaging and Presence Protocol (XMPP). Also used by Minecraft.

Some examples:

Type: SRV
Subdomain: _service._protocol.subdomain
Destination: 4 fields, separated by a space (Priority Weight Port Target)

Some more random examples:

Type: SRV
Subdomain: _minecraft._tcp.mc
Domain: yourdomain.com
Destination: 0 0 25676 dns.yourdomain.com

Type: SRV
Subdomain: _jabber._tcp
Domain: yourdomain.com
Destination: 10 0 5269 jabber.yourdomain.com

Type: SRV
Subdomain: _jabber._tcp
Domain: yourdomain.com
Destination: 20 0 5269 xmpp-server1.l.google.com

Cool tips / hidden features

1). If you use other dynamic DNS services and plan to continue using them, one easy way to keep your IP address up to date, is by simply changing your record to a CNAME in the ‘subdomains’ area to your other dynamic DNS hostname, then you do not need to bother setting up a update script to Free DNS.
2). If you use only Free DNS, and have multiple hostnames to update, you can leave 1 of them a A record, and make the rest of them CNAME’s so you do not have to issue multiple updates each time.
3). If you want to redirect your users to a webpage when you go offline, you can add the string &offline=1 to your update string, and your record will then be converted to a web forward record. To edit the offline URL, click ‘subdomains’, then click the subdomain you wish to edit, then click ‘forward to URL’ and fill it out with all your offline info, then save it.
4). If you are behind a firewall and Free DNS is not detecting your IP address correctly, you can add &address=127.0.0.2 to the update string, to override Free DNS auto-detection. To see the order and/or HTTP variables checked that Free DNS attempts to detect your IP address, you can click here

DEFINITIONS:
Direct URL – The URL used to update FreeDNS with your current IP address. You can right click the link and copy shortcut to get the update URL.

Grab URL Script – This is a link that generates a Windows .bat file you can use to update your IP address. You may however prefer to use Free DNS Clients available for a cleaner more automatic solution, not all of these are free.

Edit Record – Self explanatory. If you don’t know what this means, contact me for a brutal hazing.

The expiration time value is controlled by FreeDNS. In FreeDNS, the cache values (called a TTL, time to live) is set to 3600 seconds by default (1 hour). With that said, you must wait a maximum of one hour for your previous cache to expire.

If you wish to verify that your update has made it into FreeDNS, instead of waiting, you can query against freedns.afraid.org’s nameservers directly from your computer like so:

click start menu -> click run -> type “nslookup” without quotes, press enter. You should see a black box. Inside of it, type:

“server ns1.afraid.org” press enter
Default Server:  ns1.afraid.org
Addresses:  2607:f0d0:1102:d5::2
50.23.197.94

then phporacle.mooo.com.afraid.org.fuf.me:8083  = “yourhostname.afraid.org” press enter
*** ns1.afraid.org can’t find phporacle.mooo.com.afraid.org.fuf.me:8083: No response from server

There are also 3rd party DNS utilities available for windows that would even let you see how many seconds are left in the cache in your ISPs nameserver.

tempr.email = Fake email for email askers on inet :
[email protected] https://tempr.email/inbox.htm

Code

<?php
// J:\awww\apl\dev1\utl\ddns_whatismyip.php
// proxy_intermediate_buffer_server_request_hdr is modified
// returns first forwarded IP match it finds
// forwarded IP is of who started request
function forwarded_ip() {
 $keys = array(
 'HTTP_X_FORWARDED_FOR', 
 'HTTP_X_FORWARDED', 
 'HTTP_FORWARDED_FOR', 
 'HTTP_FORWARDED',
 'HTTP_CLIENT_IP', 
 'HTTP_X_CLUSTER_CLIENT_IP', 
 );
 
 foreach($keys as $key) {
 if(isset($_SERVER[$key])) {
 $ip_array = explode(',', $_SERVER[$key]);
 foreach($ip_array as $ip) {
 $ip = trim($ip);
 if(validate_ip($ip)) {
 return $ip; 
 }
 }
 }
 }
 return '';
}

function validate_ip($ip) {
 if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE 
     | FILTER_FLAG_NO_RES_RANGE) === false) {
 return false;
 } else {
 return true;
 }
}

$remote_ip = $_SERVER['REMOTE_ADDR'];
$forwarded_ip = forwarded_ip();
 
?>

<span style="font-weight: bold;"></span><br>
<h2>22222 What Is My IP?</h2>
 
<p>The request came from:<br>
 <strong><?php echo $remote_ip; ?></strong>
 </p>

 <?php if($forwarded_ip != '') { ?>
 
<p>The request was forwarded for:<br>
 <strong><?php echo $forwarded_ip; ?></strong>
 </p>

<?php } 

exec("del wip_web_servera.txt");
exec("J:\CURL\wget.exe -qO - http://www.icanhazip.com > wip_web_servera.txt");
if (file_exists("wip_web_servera.txt")) {
 $wip_web_servera=trim(file_get_contents("wip_web_servera.txt"));
 echo '<h2>'."My home web server IP : $wip_web_servera".'</h2>'; 
 
}
?>

or<br>
<a href="http://www.canyouseeme.org/" target="_blank">http://www.canyouseeme.org/</a><br>
<br>
<a href="https://www.whatismyip.com/" target="_blank">https://www.whatismyip.com/</a><br>
<br>
<a href="http://www.portchecktool.com/" target="_blank">http://www.portchecktool.com/</a><br>
<br>
<a href="http://www.yougetsignal.com/tools/open-ports/" 
      target="_blank">http://www.yougetsignal.com/tools/open-ports/</a>&nbsp;
<br>
<a href="https://bestvpn.org/whats-my-ip/" target="_blank"><br>
https://bestvpn.org/whats-my-ip/</a><br>
<br>
<a href="https://www.dynu.com/networktools/portcheck" target="_blank">
     https://www.dynu.com/networktools/portcheck</a><br><br>
<br>

<h2>33333 Send my IP to DDNS provider</h2>
DDNS client<br>
<br>
or<br>
<br>
<a href="http://YOURDDNSUSRNAME:YOURDDNSPSW@freedns.afraid.org/nic
/update?hostname=phporacle.mooo.com&amp;myip=<?=$wip_web_servera?>" 
target="_blank">http://YOURDDNSUSRNAME:YOURDDNSPSW@freedns.afraid.org/nic
/update?hostname=phporacle.mooo.com&amp;myip=<?=$wip_web_servera?></a>

 

 

1b. Install Apache, PHP, localhost SSL (https) On Windows 10, all newest 64 bit

HOME
Download config and php test files:  0_Apache24_conf_extra_PHP_ini.zip

Everything works. If I forgot something see URL-s in this article wich served me as tutorials. ZWAMP or simmilar and virtual hosts are not used for this basic example – Apache and PHP are extracted in C: .

Output of C:\Apache24\htdocs\index.php
(see 0_Apache24_conf_extra_PHP_ini.zip) :

Glavni izbornik (Home)

 HTML 5, CSS 3, JS, SSL.                                                             Help
1111111111 2222222222 3333333333 4444444444   444444      Home refresh (http)
4444444444 4444444444 4444444444                                        Home https

C:\Apache24\htdocs\index.php says: JS says: location.protocol=https:

 

https://www.proy.info/how-to-enable-localhost-https-on-wamp-server/
Posted On May 19th, 2017

I did mostly see below Masim Man Dec 1, 2016
1. HOW TO SET UP APACHE WITH SSL (HTTPS) ON LOCALHOST
but URL above has some clearer configs

Step 1: Download and unpack Apache lounge 64 bit (Windows 10 64 bit)
and PHP Version 7.1.9 non thread safe
httpd-2.4.27-Win64-VC15.zip, mod_fcgid-2.3.9-win64-VC15.zip
php-7.1.9-nts-Win32-VC14-x64.zip
SEE HOW TO UNPACK zip-s above : https://www.dionysopoulos.me/233-apache-mysql-php-server-on-windows-with-multiple-simultaneous-php-versions.html
or 0_Apache24_conf_extra_PHP_ini.zip above.

we have C:\Apache24 and C:\PHP\7.1.9

Step 2: Download OpenSSL (32 bits/64 bits Windows)
I did not so, see below Masim Man Dec 1, 2016

Step 3: Configure WAMP to use HTTP+SSL=HTTPS
I did not so, see below Masim Man Dec 1, 2016

Step 4: Create SSL Key and Certificate
I did not so, see below Masim Man Dec 1, 2016

Step 5: Copy the Created SSL Key and Certificate file
I did not so, see below Masim Man Dec 1, 2016

Step 6: Open httpd.conf, php.ini & uncomment
Open C:\Apache24\conf\httpd.conf and uncomment:
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
See whole scripts in .zip above.

Step 7: Open httpd-ssl.conf and make the final changes
Open c:\Apache24\conf\extra\httpd-ssl.conf (see .zip above)
find “<VirtualHost _default_:443>” and below that line find and update below configuration according to your setup:
# General setup for the virtual host
DocumentRoot “c:/Apache24/htdocs”
#ServerName www.example.com:443
ServerName localhost:443
ServerAdmin youremail
ErrorLog “c:/Apache24/logs/sslerror.log”
TransferLog “c:/Apache24/logs/sslaccess.log”
SSLEngine on
SSLCertificateFile “c:/Apache24/conf/server.crt”
SSLCertificateKeyFile “c:/Apache24/conf/server.key”
… and so on, see config files in 0_Apache24_conf_extra_PHP_ini.zip.

Open php.ini, uncomment :
extension=php_openssl.dll

Step 8: Test to make sure it works
check if you are getting Syntax is OK
C:\Apache24\bin>httpd -t
https://localhost/index.php

 

https://www.youtube.com/watch?v=Zdl68h_N2lc Masim Man Published on Dec 1, 2016 :

HOW TO SET UP APACHE WITH SSL (HTTPS) ON LOCALHOST

HTTPS (Hyper Text Transfer Protocol Secure) is a protocol for secure communication over a computer network.

Make icon for C:\Windows\SysWOW64\cmd.exe (run as admin). It shows Apache’s openssl:
openssl version -d
OPENSSLDIR: “C:\Program Files\Common Files\SSL”
openssl version
OpenSSL 1.1.0f 25 May 2017

–We create files :
1. C:\Apache24\conf\server.csr              <–OpenSSL certificate request
2. C:\Apache24\conf\server.pem            <–private key

3. C:\Apache24\conf\server.key             <–from .pem
4. C:\Apache24\conf\server.crt              <–from .key, .csr
see  below :
openssl x509 -req -signkey C:\Apache24\conf\server.key -days 1024 ^
-in C:\Apache24\conf\server.csr -out C:\Apache24\conf\server.crt

00000 –INITIAL
Change config path to where you have installed Apache :
cd C:\Apache24\bin
set OPENSSL_CONF=C:\Apache24\conf\openssl.cnf

11111 & 22222 —     ^ = ALTGRKEY+3 (3 two times)
openssl req -config C:\Apache24\conf\openssl.cnf -new ^
   -out C:\Apache24\conf\server.csr -keyout C:\Apache24\conf\server.pem
ANSWERS: only two :
writing new private key to ‘C:\Apache24\conf\server.pem’
Enter PEM pass phrase: test1
Common Name (e.g. server FQDN or YOUR name) []:localhost

33333
openssl rsa -in C:\Apache24\conf\server.pem -out C:\Apache24\conf\server.key
ANSWER: Enter pass phrase for C:\Apache24\conf\server.pem:test1
writing RSA key

44444
openssl x509 -req -signkey C:\Apache24\conf\server.key -days 1024 ^
    -in C:\Apache24\conf\server.csr -out C:\Apache24\conf\server.crt
Outputs:
Signature ok
subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = localhost
Getting Private key

55555
–C:\Apache24\conf\httpd.conf
search ssl, listen, httpd-ssl and uncomment :
LoadModule log_config_module modules/mod_log_config.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so

Listen 80
#live commented <IfModule mod_ssl.c>
Listen 443
#</IfModule>

Include conf/extra/httpd-ssl.conf

C:\Apache24\conf\extra\httpd-ssl.conf
SSLSessionCache “shmcb:c:/Apache24/logs/ssl_scache(512000)”

restart Apache
if will not start:  as sdmin in CLI
C:\Apache24\bin>httpd -t
or :
NOT httpd.exe -k restart but so:
C:\Apache24\bin>httpd.exe  — this shows error message

 

————– NEEDED FOR MS INET BROWSERS :
https://www.youtube.com/watch?v=Hhown6DgC00 Masim Man Published on Dec 2, 2016
HOW TO INSTALL AN APACHE SELF SIGNED CERTIFICATE ON WINDOWS 10
On Windows 10, a Self Signed Certificate that wasnt issued by a recognized certificate authority is not trusted by default. A Self Signed Certificates usually used on Local Web Servers (Localhost) that arent available publicly. In this case you are save to
– bypass the warning on any browsers
– or installing it to a trusted root certification authority in Windows 10.
2click C:\Apache24\conf\server.crt
in Certificate dialog Issued to and Issued by is localhost
click button “Install certificate”
for current user
place in store “Trusted root Cert. Authorities”
remove certificate localhost so:
WINKEY -> mmc -> File -> Add/remove snapp-in -> Certificates
-> Add -> My user account

1a. Install ZWAMP, Apache, PHP, MySQL, WordPress on Win 10 all 64bit, all portable (extract, setup files)

HOME

22.oct.2016
from  J:\zwamp64\z_apache_php_instalac_doc\z_doc\01_zwamp_instalac_moj.txt

Z-WAMP Server Pack (tools for Apache, PHP web pages developing on all Windows versions 32/64 bit) is a lightweight zero-install Web server package (user GUI).

1. Z-WAMP

is hosted by SourceForge: http://zwamp.sourceforge.net/
download: http://sourceforge.net/projects/zwamp/files/
latest is jan.2013  11_zwamp-x64-2.2.1-full.zip
to DIRECTORY J:\zwamp64\z_apache_php_instalac_doc\win64_x64bit
where is also coresponding MS VC++ which must be installed first (only this one installation) see below vc_redist.x64.
———————————————————-
Latest ZWAMP for Win XP which I have as web site on USB stick – they work on all Windows 32/64 bit versions :
25 MB     11_for_winXP_32bit_zwamp-i386-1.1.2.zip

Last version I extracted php for 32 bit windows xp is 5.4.*  :
11_for_wiXP_32bit_vcredist_x86_VS2008.exe
12_for_winXP_32bit_php-5.4.45-Win32-VC9-x86.zip
Last apache for 32 bit windows xp is 2.4.? or 2.2.? (see apachelounge site)

ZWAMP is Bing Cosca’s project (also author of F3 – Fat free php framework).
Latest ZWAMP 2013 year  for win 10 64 bit contains web development tools:

  1. I use only : Apache, MySQL, PHP, Adminer, – I added phpmyadmin and I extracted their latest versions to Z:\.sys (Z: is for me “J:\zwamp64\vdrive”)
  2. I do not use : MiniPerl 5.14.2, MongoDB 2.2.3,   (PHP 1.3.4 driver),  APC 3.1.13, XCache 3.0.0, XDebug 2.2.1, AdminMongoDB, MemCached, SQLite, eAccelerator, and Alternative PHP Cache (APC)
ZWAMP Version 2.2.1, 2013 year (LATEST RELEASE)
23.oct.2016 I EXTRACTED NEWEST 64 BIT VERSIONS OF  (ALL NO INSTALL, PORTABLE)
Apache 2.4.3 apachelounge
12_apache_httpd-2.4.20-win64-VC14.zip
PHP 5.4.12 12_php-7.0.12-Win32-VC14-x64.zip
MSVC14 (Visual C++ 2015)
MySQL 5.6.10 mysql-5.7.16-winx64.zip,  mysql-5.7.9-winx64.zip
see below EXTRACT PORTABLE: MYSQL
tool
Adminer 3.5.1
Adminer 4.2.5
http://dev1:8083/adminer/adminer.php
see below EXTRACT PORTABLE: MYSQL
ZWAMP does not contain phpMyAdmin phpMyAdmin 4.6.4
see below EXTRACT PORTABLE: MYSQL
ZWAMP does not contain WordPress 1_wordpress-4.6.1.zip   8.5 MB
see below EXTRACT PORTABLE: WORDPRESS

My DIRECTORY J:\zwamp64\z_apache_php_instalac_doc\win64_x64bit
contains :

***** 1. vc_redist (install this first, other SW is portable ): *****
———————————————————-
23.oct.2016 15 MB 10_2015_vc_redist.x64.exe
for .php 7.0.12 64 bit (compiled with Visual Studio 2015)
http://www.microsoft.com/en-us/download/details.aspx?id=48145

—               ***** 2. Apache : *****
—————————————————-
3.jul.2016. 14 MB 12_apache_httpd-2.4.20-win64-VC14.zip
do not forget comment/uncomment:
#LoadModule php5_module /.sys/php/php5apache2_4.dll
LoadModule php7_module /.sys/php/php7apache2_4.dll
in J:\zwamp64\vdrive\.sys\Apache2\conf\httpd.conf
and :

# ZWAMP does:   (subst Z: "J:\zwamp\vdrive")
Listen 8083
# dir J:\zwamp64\vdrive\.sys\php is :
PHPIniDir /.sys/php
# dir J:\zwamp64\vdrive\.sys\php is
<IfModule alias_module>
  # dir. J:\zwamp64\vdrive\.sys\adminer is :
  # http://localhost:8083/adminer/
 Alias /adminer /.sys/adminer
  <Directory /.sys/adminer>
    Options All
    AllowOverride AuthConfig
    Require all granted
  </Directory>

  # http://localhost:8083/phpmyadmin/  
  # WE NEED WAMP WAY for WAMP main menu group 3. Aliases & virt.hosts :
  # J:\zwamp64\vdrive\alias\phpmyadmin.conf for me is all commented
  Alias /phpmyadmin /.sys/phpmyadmin
  <Directory /.sys/phpmyadmin>
    Options All
    AllowOverride AuthConfig
    Require all granted
  </Directory>
</IfModule>

—               ***** 3.1 PHP : *****
————————————————-
http://windows.php.net/download
build date Oct 13 2016 24 MB 12_php-7.0.12-Win32-VC14-x64.zip
oct.2016 23 MB 12_php-5.6.27-Win32-VC11-x64.zip
oct.2015 21 MB 12_php-5.5.38-Win32-VC11-x64.zip
works, oci8 for php7 is supported !!
see trick with php_oci8_11g.dll below

—               ***** 3.2 memcache CURL : *****
—————————————————–
CURL is compiled with php7.0.12,
I do not use memcache (any cache) for now (not needed ?)

—               ***** 4. DB  *****
———————————————————-

—               ***** 4.1 DB sqlite : *****
13.08.2015.  164 kB tema.sqlite
—               ***** 4.2 sqlite develop. tools : *****
24.06.2015.  25 MB 14_sqlitestudio-3.0.6.zip
29.03.2015.  98 kB 14_SQLiteStudio_User Manual.htm

—————————————————-
—         ***** 4.2 DB Oracle 11gXE 64 bit : *****
—————————————————-
332 MB 1_OracleXE112_Win64.zip
see below OracleXE112 INSTALL
see below CONNECT PHP TO OracleXE112
—               ***** Oracle develop. tools : *****
—               Orcle sqldeveloper
—               Orcle sqldeveloper data modeler
—               IDE Netbeans I do not use

—     —————————————————–
—     ***** 4.3 DB mysql (SEE BELOW MYSQL EXTRACT GUIDE) : *****
—     —————————————————–
23.oct.2016.  349 MB 14_mysql-5.7.16-winx64.zip

——————————————————–      —          *****  mysql develop. tools *****
——————————————————-
23.oct.2016.  6 MB  16_phpMyAdmin-4.6.4-all-languages.7z
compatible with PHP 5.5 to 7.0 and MySQL 5.5 and newer.
SHA256: 89ce2055402ea3052d380aebddf3c9c5bfc4ed686f49b98ee2e0f6ec6a3ded6c
old: 16_phpMyAdmin-4.5.0.2-all-languages.7z

23.oct.2016. 283 kB 16_adminer-4.2.5-en.php I renamed to :
J:\zwamp64\vdrive\.sys\adminer\adminer.php
01.06.2016   413 kB adminer-4.2.4.php,  570 kB 16_adminer-master.zip

23.10.2015. 33 MB
15_mysql-workbench-community-6.3.5-winx64-noinstall.zip

2. EXTRACT PORTABLE: MYSQL, PHPMYADMIN, ADMINER

22.oct.2016
http://dev.mysql.com/downloads/mysql/
(phpinfo() shows: mysqli mysqlnd 5.0.12-dev –  20150407 ?)
MD5: 1b23c0ddaa1ad59465fd1702b864e4a3
—–BEGIN PGP SIGNATURE—–  I do not use this
Version: GnuPG v1

iD8DBQBX7U37jHGNO1By4fURAkIGAJ9vU5VfOLHqDnZvvrtq/B/n6jE3MQCgh4C1
9sR5bRIkjwpwJ5Adjekc7uA=
=9Kxd
—–END PGP SIGNATURE—–

348 MB  14_mysql-5.7.16-winx64.zip
36 MB   14_mysql_refman-5.7.16-en.a4.pdf
http://dev.mysql.com/doc/refman/5.7/en/  http://dev.mysql.com/doc/

A bit more difficult for beginner user is to integrate newest
Apache. php, mysql, phpmyadmin, adminer in ZWAMP
(all portable = extract  & setup & run).

Testing MySQL is best in console (command prompt) window – best mysql msgs.
I did not use MSI mysql installer (is it better ?)
======================================================

If using no install mysql zip, you need to:

1. ***EXTRACT MYSQL***
unzip  J:\zwamp64\z_apache_php_instalac_doc\win64_x64bit\14_mysql-5.7.16-winx64.zip
to ZWAMP dir:  J:\zwamp64\vdrive\.sys\mysql (rename old to mysql_5_7_9)

2. Create ***OPTIONS*** file my.ini – see my.ini below
or copy my.ini from mysql_5_7_9 dir to mysql dir
Optional I id not:   extract the debug-test archive if you plan to execute the MySQL benchmark and test suite

???I DID NOT: Choose a MySQL ***SERVER TYPE***, it could be :
it is server-id    = 1 ???
– mysqld Optimized binary with named-pipe support
– or mysqld-debug – like mysqld, but compiled with
full debugging and automatic memory allocation checking

3. ***INITIALIZE MYSQL***
3.1 Freecommander in admin mode and click CLI icon
or (I did):
make icon C:\Windows\SysWOW64\cmd.exe -> right click -> run as admin
J:
cd J:\zwamp64\vdrive\.sys\mysql

3.2   .\bin\mysqld –initialize-insecure –user=mysql

MySQL ee mysqld creates dir :
J:\zwamp\vdrive\.sys\mysql\data – we can move it if needed

data dir we can delete to try –initialize-insecure again if
installation was unsuccesfull as my was first time I used
–initialize mysqld parameter
I did not know how resolve errors – same as MANY PEOPLE ON WEB FORUMS :
‘Access denied for user ‘root’@’localhost’
or
‘Your password has expired

4. ***START*** MySQL server :
4.1 First this to be able to do 4.2 !! :
Establish ZWAMP try icon & start Apache and mysql
(or 2click on: J:\zwamp64\zwamp.exe)
Rightclick on ZWAMP try icon
– standard ZWAMP, WAMP or XAMPP functions.

ZWAMP Services menu item should show apache and mysql started.

4.2 Execute mysql.exe to ***OPEN MYSQL CONNection***
to open mysql prompt:
J:
cd J:\zwamp\vdrive\.sys\mysql

.\bin\mysql -u root -p 
Enter password: *****
press ENTER key if you not yet have root psw *****
then ***GIVE PASSWORD TO ROOT USER***
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘root’;
         exit
So we avoided error:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Then again :
.\bin\mysql -u root -p

or .\bin\mysql -u root -h 127.0.0.1 –skip-password

If we try 4.2 without ZWAMP started (5.1) :
Enter password: ****
ERROR 2003 (HY000): Cant connect to MySQL server on ‘localhost’ (10061)

Why we need password :
– secure default user accounts
– Portable phpMyAdmin says “Login without psw is forbidden by configuration”

5. MYSQL TOOLS

http://dev1:8083/phpmyadmin – login into mysql with portable phpMyAdmin works after :
rename J:\zwamp64\vdrive\.sys\phpMyAdmin to phpMyAdmin_4_5_0_2
16_phpMyAdmin-4.6.4-all-languages.7z  6 MB ***phpMyAdmin EXTRACT*** to :
J:\zwamp64\vdrive\.sys\phpMyAdmin
copy J:\zwamp64\vdrive\.sys\phpMyAdmin_4_5_0_2\config.inc.php
to J:\zwamp64\vdrive\.sys\phpMyAdmin\config.inc.php
see below config.inc.php

http://dev1:8083/adminer/adminer.php — login into mysql with portable adminer works
— login into oracle 11gXE with portable adminer works
16_adminer-4.2.5-en.php 283 kB copyed to adminer dir
same as phpMyAdmin and renamed to adminer.php, no setup file changes required

http://dev1:8083/adminer/ed/editor.php — is only for mysql DB

http://dev1:8083/adminer/ed/oraed.php — is only for Oracle DB

ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ end mysql 64 bit installation

http://dev1:8083/phpmyadmin displays:

Database server
Server: localhost via TCP/IP
Server type: MySQL
Server version: 5.7.16 – MySQL Community Server (GPL)
Protocol version: 10
User: root@localhost
Server charset: UTF-8 Unicode (utf8)

Web server
Apache/2.4.20 (Win64)
Database client version: libmysql – mysqlnd 5.0.12-dev – 20150407 – $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 7.0.12

phpMyAdmin
Version information: 4.6.4 (up to date)
Documentation
Official Homepage
Contribute
Get support
List of changes
License

Starting MySQL from the Windows Command Line
=======================================
mysqld — corresponds to Oracle DB server daemon(TSR) service name (XE)

Stop MySQL server by executing this command:
mysqladmin -u root -p shutdown

Start mysqld with the –standalone and –debug options. In debug case, mysqld writes a log file C:\mysqld.trace that should contain the reason WHY MYSQLD DOESNT START. See Section 24.5.3, “The DBUG Package”.
Use mysqld –verbose –help to display all the options that mysqld supports.

2.3.5.6 Customizing the PATH for MySQL Tools
============================================
To make it easier to invoke MySQL programs, you can add the path name of the MySQL bin directory to your Windows system PATH environment variable.
You should not add the MySQL bin directory to your Windows PATH if you are running multiple MySQL servers on the same machine.

https://www.adminer.org/#download
Adminer – Database management in a single PHP file
Adminer Editor – Data manipulation for end-users

https://www.adminer.org/
Supports: MySQL, PostgreSQL, SQLite, MS SQL, Oracle, SimpleDB, Elasticsearch
Requirements: PHP 5+
Apache License 2.0 or GPL 2

To see what databases (users in Oracle DB terminology) exist :
————————————————-
(in oracle DB user coresponds to mysql DB)
goto J:\zwamp64\vdrive\.sys\mysql\bin

mysqld –help
mysqld  Ver 5.7.16 for Win64 on x86_64 (MySQL Community Server (GPL))
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Starts the MySQL database server.

Usage: mysqld [OPTIONS]

For more help options (several pages), use
mysqld –verbose –help

mysqlshow -u root -p
+——————–+
|     Databases      |
+——————–+
| information_schema |
| blogwp             |
| mysql              |
| performance_schema |
| sys                |
+——————–+
Two DB ar minimum.

mysqlshow -u root mysql
Database: mysql
+—————————+
|          Tables           |
+—————————+
| columns_priv              |
| db                        |

+—————————+

To select information from a table in the mysql database :
mysql -e “SELECT User, Host, plugin FROM mysql.user” -u root mysql
+———–+———–+———————–+
| User      | Host      | plugin                |
+———–+———–+———————–+
| root      | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
+———–+———–+———————–+

mysqladmin -u root version status proc
mysqladmin  Ver 8.42 Distrib 5.7.16, for Win64 on x86_64
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Server version          5.7.16
Protocol version        10
Connection              localhost via TCP/IP
TCP port                3306
Uptime:                 41 min 55 sec

Threads: 1  Questions: 21  Slow queries: 0  Opens: 115  Flush tables: 1  Open tables: 0  Queries per second avg: 0.008
Uptime: 2515  Threads: 1  Questions: 22  Slow queries: 0  Opens: 115  Flush tables: 1  Open tables: 0  Queries per second avg: 0.008
+—-+——+—————–+—-+———+——+———-+——————+
| Id | User | Host            | db | Command | Time | State    | Info             |
+—-+——+—————–+—-+———+——+———-+——————+
| 11 | root | localhost:50191 |    | Query   | 0    | starting | show processlist |
+—-+——+—————–+—-+———+——+———-+——————+

To display all the options that mysqld supports:
.\bin\mysqld –verbose –help

J:\zwamp\vdrive\.sys\mysql>.\bin\mysql -u root -p
Enter password:
mysql> SELECT User, Host, Password FROM mysql.user;
ERROR 1054 (42S22): Unknown column ‘Password’ in ‘field list’
mysql> SELECT User, Host FROM mysql.user;
+———–+———–+
| User      | Host      |
+———–+———–+
| mysql.sys | localhost |
| root      | localhost |
+———–+———–+
2 rows in set (0.00 sec)

# ————————————-
# my.ini     mysql 5.7.16 config file
# ————————————-
# J:\zwamp64\vdrive\.sys\mysql\my.ini
[client]
password    = root
port          = 3306
socket        = /.tmp/mysql.sock

[mysqld]
basedir = J:/zwamp64/vdrive/.sys/mysql
datadir = J:/zwamp64/vdrive/.sys/mysql/data
# default IPv6 change to ipv4
bind-address = 0.0.0.0
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K
sync_binlog = 0
explicit_defaults_for_timestamp = TRUE
server-id    = 1

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
safe-updates

[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

# ————————————-
# config.inc.php   phpMyAdmin 4.6.4 config file
# ————————————-
// J:\zwamp64\vdrive\.sys\phpMyAdmin\config.inc.php
$cfg[‘blowfish_secret’] = ”; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$i = 0;
$i++;
/* Authentication type */
//$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
//  if you prefer to not be prompted every time you log in:
$cfg[‘Servers’][$i][‘user’]          = ‘root’;
$cfg[‘Servers’][$i][‘password’]      = ‘root’; // use here your password
//$cfg[‘Servers’][$i][‘auth_type’]     = ‘config’;
/* Server parameters */
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘compress’] = false;
$cfg[‘Servers’][$i][‘AllowNoPassword’] = false;

$cfg[‘UploadDir’] = ”;
$cfg[‘SaveDir’] = ”;

3.  EXTRACT PORTABLE: WORDPRESS

http://sspc1:8083/papl1/blogwp/wp-admin/  = Control panel (Ndzorna ploča)
http://sspc1:8083/papl1/blogwp/  = articles, posts, članci, objave

http://sspc1:8083/papl1/blogwp/primjer-stranice/ = page

http://sspc1:8083/papl1/blogwp/2016/10/22/dan-svijete/

http://sspc1:8083/papl1/blogwp/wp-admin/about.php

https://wordpress.org/download/
http://codex.wordpress.org/Installing_WordPress

1. extract 1_wordpress-4.6.1.zip, 8.5 MB
to
J:\zwamp64\vdrive\web\papl1\blogwp

2. 5-Minute Installation
————————

11111 start apache & mysql

start ZWAMP
rightclick ZWAMP icon and check services apache and mysql are running

22222 create mysql DB and user for WordPress blog

z:
dir .sys
cd .sys\mysql\bin
mysqlshow -u root -p
mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

1.        mysql> DROP DATABASE blogwp; (possible repeat this)
1.        mysql> CREATE DATABASE blogwp;
2.cre usr mysql> GRANT ALL PRIVILEGES ON blogwp.* TO “blogwp”@”localhost”
-> IDENTIFIED BY “blogwp”;
3. mysql>        FLUSH PRIVILEGES;
4. mysql>        EXIT

or in GraphicUI which creates statements below :

http://dev1:8083/phpmyadmin/
create db blogwp collation utf8_… ,:
New link on left top

CREATE USER ‘blogwp’@’%’ IDENTIFIED WITH mysql_native_password BY ‘***’;
GRANT ALL PRIVILEGES ON *.* TO ‘blogwp’@’%’ REQUIRE NONE WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT ALL PRIVILEGES ON `blogwp`.* TO ‘blogwp’@’%’;
REVOKE ALL PRIVILEGES ON `blogwp`.* FROM ‘blogwp’@’%’;
GRANT ALL PRIVILEGES ON `blogwp`.* TO ‘blogwp’@’%’ WITH GRANT OPTION;

33333 install WordPress blog tables to MySQL DB

http://sspc1:8083/papl1/blogwp/
or http://sspc1:8083/papl1/blogwp/wp-admin/install.php
Needed info about DB:
DB name               blogwp
DB user name          blogwp
DB psw                blogwp
Host of DB            localhost  or PC name eg SSPC1 or domain name eg http://www.mysite.hr
tables Prefiks        blogwp
(if we want more WordPress installations in one DB)

Above info is used to create wp-config.php file. Also you can edit
wp-config-sample.php. See https://codex.wordpress.org/Editing_wp-config.php

psw=…  email=…

Akismet blog spam protection needs :
email,  usr/psw, API key
https://akismet.com/account/

http://sspc1:8083/papl1/blogwp/  = articles, posts, članci, objave
http://sspc1:8083/papl1/blogwp/wp-admin/  = control panel

44444  WordPress Importer

will import the following content from a WordPress export file:
posts, pages, comments, categories, and other content.
<!–J:\zwamp64\vdrive\web\papl1\blogwp\1_phporacle.wordpress.2016-10-22.xml
This is a WordPress eXtended RSS file (WXR) generated by WordPress as an export of your site.
–>
<!– You may use this file to TRANSFER CONTENT FROM ONE SITE TO ANOTHER. –>
<!– This file is not complete backup of your site. –>

<!– TO IMPORT THIS INFORMATION INTO A WORDPRESS SITE : –>
<!– 1. Log in to that site as an administrator. –>
<!– 2. Go to TOOLS: IMPORT IN THE WORDPRESS ADMIN PANEL. –>
<!– 3. Install the “WordPress” importer from the list. –>
<!– 4. Activate & Run Importer. –>
<!– 5. Upload this file using the form provided on that page. –>
<!– 6. You will first be asked to MAP THE AUTHORS IN THIS EXPORT FILE TO USERS –>
<!–    on the site. For each author, you may choose to map to an –>
<!–    existing user on the site or to create a new user. –>
<!– 7. WORDPRESS WILL THEN IMPORT each of the posts, pages, comments, categories, etc. contained in this file into your site. –>
<!– generator=”WordPress/4.6.1″ created=”2016-10-22 12:46″ –>

If you would prefer to do things manually then follow these instructions:
Upload the wordpress-importer folder to the /wp-content/plugins/ directory
Activate the plugin through the ‘Plugins’ menu in WordPress
Go to the Tools -> Import screen, click on WordPress

Remember to update the passwords and roles of imported users.

Many web hosts now offer tools (e.g. Fantastico) to automatically install WordPress for you.
WordPress  has Automatic upgrading.

Things to Know/todo Before You Begin Installing WordPress
————————————————
– Access to web server (via FTP or shell)
– text editor
– FTP Client
– Web browser (K-meleon, Firefox, Google Chrome)

Minimum requirements to run WordPress:
– PHP version 5.6 or greater
– MySQL version 5.6 or greater OR . – MariaDB version 10.0 or greater -http://dev1:8083/phpmyadmin/
WordPress also works with PHP 5.2.4+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities.

******************************************************
OracleXE112 INSTALL
******************************************************
see my other article or just install it as any Windows program.

4. CONNECT PHP 7.0.12  TO Oracle 11g r2 XE

Oracle instantclient is not needed if all is on home development PC :
OCI8 Extension – WORKS FOR PHP 7.0.12 64 BIT build date Oct 13 2016

Use php 7.0.12 OCI8 extension to access Oracle Database 11g XE from PHP

I did for php 7.0.12, 64 bit:
———————-
download: https://pecl.php.net/package/oci8
https://pecl.php.net/package/oci8/2.1.2/windows
7.0 Thread Safe (TS) x64
TRICK: from J:\zwamp64\vdrive\.sys\php\ext\1_php_oci8-2.1.2-7.0-ts-vc14-x64.zip   20.sep.2016 734 kB
extract php_oci8_11g.dll in J:\zwamp64\vdrive\.sys\php\ext

I also installed  php 5.6.27, 64 bit:
—————————–
I renamed php dir to php_7_0_12
I renamed php_5_6_27 dir to php
download: https://pecl.php.net/package/oci8/2.0.12/windows
5.6 Thread Safe (TS) x64
from J:\zwamp64\vdrive\.sys\php\ext\1_php_oci8-2.0.12-5.6-ts-vc11-x64.zip     20.sep.2016 581 kB
extract php_oci8_11g.dll in J:\zwamp64\vdrive\.sys\php\ext

OCI8 php extension needs to be linked with Oracle 12, 11, or 10.2
client libraries.  These libraries are found in your database installation,
or (I did not this) :   in the free Oracle Instant Client from
http://www.oracle.com/technetwork/database/features/instant-client/
Install the ‘Basic’ or ‘Basic Lite’ Instant Client package.  If
building from source, then also install the SDK package.
aug.2015.  55 MB 18_instantclient-basic-windows.x64-11.2.0.4.0.zip
nov.2014.  73 MB instantclient-basic-windows.x64-12.1.0.2.0.zip

Oracle standard cross-version connectivity applies.  For example,
PHP OCI8 linked with Instant Client 11.2 can connect to Oracle
Database 9.2 onward.  See Oracle note “Oracle Client / Server
Interoperability Support” (ID 207303.1) for details.

see README of pecl oci8 dll-s zip above
see Documentation is at http://php.net/oci8

8. Understand AngularJS (ng) ver. 1.4.3 & PHP server script Get Emp from Oracle DB 11g

HOME   – Download code

2.Sept.2015  I uploaded  ng_understand.rar – it contains now all CRUD code.

It seems to me that ng is very nice but brings no advantage – PHP is enough, and problem is to learn two programming techniques, to include ng (minimum 150 kB) …

We fill in $scope ng object with Oracle DB 11g data with help of
AJAX “client-server” PHP script get_emp_data.php (hr user).

Output page shows (looks better with .css included in zip):

ng & PHP server script Get Emp from oracle DB 11g

Search:

EmpId LastName HireDate
DML: select EMPLOYEE_ID, LAST_NAME, HIRE_DATE from (select EMPLOYEE_ID, LAST_NAME,to_char(HIRE_DATE,’RRRR.DD.MM’) HIRE_DATE from EMPLOYEES order by LAST_NAME) where ROWNUM < 11
167 Banda 2008.21.04
116 Baida 2005.24.12

This script get_emp.html 15.7.2015 says:

  1. Script get_emp.html is same as index.html – understand ng.
    Included is app.js code for quick testing.
    Added are few additional lines to fill in $scope object from Oracle DB 11g data with help of
    AJAX “client-server” called PHP script get_emp_data.php.
  2. Search field works after every character typed in.
  3. Click on eg HireDate column title works but not for both sorts asc/desc – I shall do this later.
  4. I shall add later to this post (to ng_understand.zip)
    all CRUD functions in programming techniques :
    ng – PHP server scripts called with AJAX (client-server web programming technique) – Oracle DB 11g.

    // get_emp.html contains app.js code for quick testing
    // HH24:mi:ss
    $http.get("get_emp_data.php?sqlStr="
      +"select EMPLOYEE_ID, LAST_NAME, HIRE_DATE from"
      +" (select EMPLOYEE_ID,  LAST_NAME"
      +   ",to_char(HIRE_DATE,'RRRR.DD.MM') HIRE_DATE
      + " from EMPLOYEES order by LAST_NAME)"
      +" where ROWNUM < 11"
    )
    .success(
        function(response) {
          $scope.myData  = response;
          $scope.reverse = true;
        }
    )  
    .error(
       function() {
                
            }
    ) ;
  5. AJAX “client-server” called PHP script get_emp_data.php has ~five important statements:
    <?php
    /*
    http://dev1:8083/my_dev/test/...get_emp_data.php
    http://dev1:8083/my_dev/test/...get_emp_data.php?sqlStr=select...
    J:\awww\apl\dev1\my_dev\test\...get_emp_data.php
    */
    $pdo=new PDO('oci:dbname=sspc/XE','hr','hr');
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $stmt = $pdo->prepare($_GET['sqlStr']);
    /*
    $stmt = $pdo->prepare(
      'select EMPLOYEE_ID,  LAST_NAME'
      .',to_char(HIRE_DATE,\'DD.MM.RRRR\') HIRE_DATE' // HH24:mi:ss
      .' from EMPLOYEES where ROWNUM < 16'
    );
    */
    
    $stmt->execute();
    $arr = array();
    while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
       $arr[] = $row;
    }
    //echo '<pre>'; print_r($arr); echo '</pre>';
    //$arr = $_GET; // {"sqlStr":"select..."}
    
    $arr[] = Array (
        'EMPLOYEE_ID' => "DML:"
       ,'LAST_NAME'   => $_GET['sqlStr']
       ,'HIRE_DATE'   => ''
    );
    //{"EMPLOYEE_ID":"114","LAST_NAME":"Raphaely","HIRE_DATE":"07.12.2002"},
    //{"EMPLOYEE_ID":-1,"LAST_NAME":"select...","HIRE_DATE":""}]
    $json_response = json_encode($arr);
    echo $json_response;
    ?>

6. CRUD selfjoin table forum – message board PDO SQLite

HOME   . Downloads

Excellent code to learn object oriented programming, model-view-controller code separation (structured programming), single page application (4 utility-helper functions + 5 CRUD functions), all one selfjoin table CRUD code in one script, require scripts, not URL them, most code outside Apache doc root, Javascript msg & yes-no dialogs and key TAB->ENTER.
(see Home -> site_ver2.rar).

6.Dec.2015 code refactored and parialy improved. Later (next year) I shall finish all I planed and upload also  site_ver2.rar where is code outside appl. root. Below is newest code, other is in
Home -> site_ver2.rar

2.Sept.2015 Download – see site_ver2.rar from my article 9. Code below is enough to understand – it is not much changed.

1. Download sqlitestudio and install DDL at end tema.php

2.     1_sync_tema_sifrarnik_JtoH.bat

rem SINCHRONIZATION: 2 click this .bat script (or Git)
rem J:\awww\apl\dev1\01apl\04tema\1_sync_tema_sifrarnik_JtoH.bat
rem
rem robocopy <Original Folder> <Destination Folder> /e /purge
rem **** OUTPUTS EG : *****
rem Total Copied Skipped Mismatch FAILED Extras
rem Dirs : 20 0 20 0 0 0
rem Files : 94 6 88 0 0 0
rem Bytes : 453.9 k 36.6 k 417.2 k 0 0 0
rem Times : 0:00:00 0:00:00 0:00:00 0:00:00
rem
rem Speed : 708811 Bytes/sec. 40.558 MegaBytes/min.
rem Ended : 6. prosinca 2015. 20:33:19

rem 1. resources outside appl. tree - utils, settings, css, img
rem 1.1 
robocopy J:\awww\apl\dev1\config_site.php H:\awww\apl\dev1\config_site.php /e /purge
rem 1.2
robocopy J:\awww\apl\zinc H:\awww\apl\zinc /e /purge

rem 2. inside appl. tree
robocopy J:\awww\apl\dev1\01apl\04tema H:\awww\apl\dev1\01apl\04tema /e /purge

pause

3. tema.php Code – all in one script ~350 lines :

<?php
/**
* Themes (threads) (msg-reply, task, menu) 
* Teme (niti) (poruka-odgovor, zadaća, izbornik)
* PHP, Javascript, PDO SQLite3, selfjoin, 2015.12.7
*
* LICENCE: Free code example - if you use it, do not remove this:
* Slavko Srakočić, Croatia, Zagreb
* see my blog http://phporacle.altervista.org
*
*
* 1. ADRESSES :
* J:\awww\apl\dev1\01apl\04tema\tema.php
* http://dev1:8083/01apl/04tema/tema.php
*
* 2. robocopy (or Git) SYNCHRONIZATION: 2 click this .bat script (or git)
* J:\awww\apl\dev1\01apl\04tema\1_sync_tema_sifrarnik_JtoH.bat
*
* 3. DDL: see CREATE TABLE message at this script end
*
* 4. Home page looks like :
* Open new thema (nit, thread) Help = Klik Ord.Nr
* |...| = |bytes| idniti, rbruniti, nivo, id, idviši |
* 1. MSGs self join sqlite3 THIS PG by ss @ 2015-03-25 01:41 |DELETE| 1900 |UPDATE |1,0,0 ,1,0|
*     1. funkcije by ss @ 2015-03-25 01:42 |DEL| 1654 |UPD|1,1,1 ,2,1|
*          2. Re: funkcije by ss @ 2015-03-26 14:31 |DEL| 14 |UPD|1,2,2 ,18,2|
*     3. funkcija save() by ss @ 2015-03-25 01:52 |DEL| 1296 |UPD|1,3,2 ,3,2|
* ...
* 2. Z-WAMP menu by aa @ 2015-12-05 15:58 |DELE| 14 |UPD |3,0,0 ,25,0|
*
*
* 5. PHP CREATED JAVASCRIPT MSG & YES-NO DIALOGS :
* $this->utl->phpjsmsg(7 parameters), phpjsmsgyn() 
* 6. F U N C T I O N S IN THIS SCRIPT
*LINE FUNCTION WHAT (HOW) IS DOING 
*89: public __construct() { // INITIALIZE (B O O T S T R A P I N G)
*151: public ctr() { // M A N A G E (R O U T I N G)
*192: protected crerec() { // crud1. FRONTEND A D D SELFJOIN ROW
*257: protected tbl() { // crud2. D I S P L A Y HIERARCHY
*363: protected frm_rpt() { // crud3. R O W REPORT (m s g b o d y...)
*417: protected frm_post() // crud4. ENTER USER DATA & PROCESS IT
*491: protected delrec() { // crud5 BACKEND D E L E T E R O W
*522: protected valid() {
*538: protected logAndDie(Exception $e) {
*
*/
use utlmoj\utlmoj as utl;

ini_set('max_execution_time', 0);
$start = microtime(true);

$selfj = new SelfJoin(); // should be named: MessageBoard, MainMenu...
$selfj->ctr(); //ROUTING = starts scripts according url params cmd, ... 

$end = microtime(true);

echo '<br />'.'Vrijeme izvođenja: '.($end - $start) . ' sekundi';

class SelfJoin { // should be named: MessageBoard, MainMenu...
 
 // 1. C R U D (M O D E L) PROPERTIES :
 protected $inTransaction = false;
 
 protected $db;
 protected $table;
 protected $idname;
 protected $idval;
 // c r u d actions (CURSORS = named sql set process comands):
 // D = cursor for deleting
 protected $cdel_row_byid ; 
 // R e a d cursor
 protected $cr_max_rbrdet_inm ;
 protected $cr_byid_nivo_orddet_inm ;
 protected $cr_byid ; // R E A D r o w B Y I D (M O D E L c R u d)
 protected $cr_byid_colname ; 
 // U p d a t e cursor
 protected $cu_incr_rbrdet_inm ;
 // C r e a t e cursor
 protected $cc_mast_or_det ;
 
 // 2. U T L S F U N C T I O N S (H E L P E R S) :
 protected $utl; // OUTSIDE WEBSERVERDOCROOT
 // a d r e s s properties :
 protected $curpgurl;
 protected $curpgpath;

 // 3. V I E W PROPERTIES :
 protected $form_errors = array();
 
 
 public function __construct() { // I N I T I A L I Z E (B O O T S T R A P I N G)
 set_exception_handler(array($this,'logAndDie'));
 
 // C R U D (m o d e l) properties :
 $this->table = 'message';
 $this->idname = 'id';
 $this->idval_url = isset($_REQUEST[$this->idname]) ?
 intval($_REQUEST[$this->idname]) : '';
 
 // C R U D actions (cursors, named sql set process comands):
$this->cdel_row_byid = // cd_ means cursor for deleting
"DELETE FROM $this->table WHERE $this->idname=?"; //$values[]=$parent_id;

$this->cr_max_rbrdet_inm;
"SELECT MAX(thread_pos) FROM $this->table WHERE thread_id = ? AND parent_id = ?"; 

$this->cr_byid_nivo_orddet_inm= // cr_ means cursor for reading
"SELECT thread_id,level,thread_pos FROM $this->table WHERE $this->idname=?";

$this->cu_incr_rbrdet_inm=
"UPDATE $this->table SET thread_pos = thread_pos + 1 WHERE thread_id = ? AND thread_pos >= ?";

$this->cc_mast_or_det="INSERT INTO $this->table "
. "($this->idname, thread_id,parent_id, thread_pos, posted_on, level, author, subject, body) "
.'VALUES (?,?,?,?,?,?,?,?,?)';

$this->cr_byid=
"SELECT author,subject,body,posted_on FROM $this->table WHERE $this->idname = ?";

$this->cr_byid_colname=
"SELECT subject FROM $this->table WHERE $this->idname = ?";

 
 // 1. g l o b a l u t l s, s e t t i n g s :
 $curpgpath =__FILE__; $mastpgpath=$curpgpath; //dirname(__DIR__) ;
 $this->curpgpath = $curpgpath;
 require_once($_SERVER['DOCUMENT_ROOT'].'/config_site.php');
 $this->curpgurl = $curpgurl ; 
 //htmlentities($_SERVER['PHP_SELF'],ENT_QUOTES);
 //$_SERVER['DOCUMENT_ROOT'] = eg J:\awww\apl\dev1\
 
 $this->utl = $utl;
 
?><SCRIPT LANGUAGE="JavaScript"><!-- Begin 
<?php echo file_get_contents($jsd.$ds.'key_pressed.js');?>//End --></SCRIPT><?php if ('') $utl->phpjsmsg('aaaaaaaaaa key_ pressed.js IS INCLUD E D');
 
 // 2. g l o b a l c r u d :
 $dbi = 'sqlite3'; $sqlitetbl = 'tema.sqlite3' ; //$dsn='default';
 require_once($gloresdir.$ds.'db_conn.php'); //requires klase/dbi.php
 $this->db = $db;
// ******************************************
 $title = '<h1>Teme (threads) (poruka-odgovor, zadaća, izbornik) selfjoin PHP PDO SQLite3</h1>' ;
 $title2 = 'Teme selfjoin'; // ibrowser tab txt
 $basecss=$cssd.$ds.'style00.css'; //'default' or $cssd.$ds.'style00.css';
 include ($gloresdir.'/hdr.php');
 //include ($cnfgd.$ds.'hdr.php');

 } // e n d _ _ c o n s t r u c t
 
 
 
 
 public function ctr() { // M A N A G E (R O U T I N G)
 // The value of $_REQUEST['cmd'] tells us what to do
 $cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : 'tbl';
 // frontend - user actions (backend in sqlitestudio) :
 switch ($cmd) {
 case 'delrec':
 $this->utl->phpjsmsgyn('Obrisati redak ?'
 , '?cmd=delrecyes&'.$this->idname.'='.$this->idval_url);
 break;
 case 'delrecyes': 
 //case 'delrec': 
 if ($this->idval_url) $this->delrec($this->idval_url);
 else $this->utl->phpjsmsg('Nije zadana šifra retka za brisanje !');
 $this->tbl();
 break;
 case 'frm_rpt': // read an self join r o w
 $this->frm_rpt();
 break;
 case 'frm_post': // display form to post self join r o w
 $this->frm_post();
 break;
 case 'crerec': // insert - i n s e r t posted self join r o w
 if ($this->valid()) { // if m s g e is v a l i d,
 $this->crerec(); // then i n s e r t it
 $this->tbl(); // and display self join list
 } else {
 $this->frm_post(); // otherwise, redisplay the posting form
 }
 break;
 case 'tbl': // show self join r o w s list
 default:
 $this->tbl();
 break;
 }
 }





 // F R O N T E N D - user actions :
 protected function crerec() { // crud1. FRONTEND A D D SELFJOIN ROW
 $parent_id = isset($_REQUEST['parent_id']) ?
 intval($_REQUEST['parent_id']) : 0;
 // Make sure m s g e doesn't change while we're working with it.
 $this->db->beginTransaction();
 $this->inTransaction = true;
 // is this m s g e a reply?
 if ($parent_id) {
 // get the thread, level, and thread_pos of the parent m s g e
 //"SELECT thread_id,level,thread_pos FROM $this->table WHERE $this->idname=?";
 $st = $this->db->prepare($this->cr_byid_nivo_orddet_inm);
 $st->execute(array($parent_id));
 $parent = $st->fetch();
 // a reply's level is one greater than its parent's
 $level = $parent['level'] + 1;
 // what's biggest thread_pos in this thread among m s g e s with the same parent? 
 //"SELECT MAX(thread_pos) FROM $this->table WHERE thread_id = ? AND parent_id = ?";
 $st = $this->db->prepare($this->cr_max_rbrdet_inm);
 $st->execute(array($parent['thread_id'], $parent_id));
 $thread_pos = $st->fetchColumn(0);
 // are there existing replies to this parent?
 if ($thread_pos) {
 // this thread_pos goes after the biggest existing one
 $thread_pos++;
 } else {
 // this is the first reply, so put it right after the parent
 $thread_pos = $parent['thread_pos'] + 1;
 }
 // increment thread_pos of all m s g e s in the thread that come after this one 
 //"UPDATE $this->table SET thread_pos = thread_pos + 1 WHERE thread_id = ? AND thread_pos >= ?";
 $st = $this->db->prepare($this->cu_incr_rbrdet_inm);
 $st->execute(array($parent['thread_id'], $thread_pos));
 // the new m s g e should be i n s. with the parent's thread_id
 $thread_id = $parent['thread_id'];
 } else {
 // m s g e is not reply, so it's the s t a r t of new t h r e a d
 $thread_id = $this->db->query(
 "SELECT MAX(thread_id) + 1 
 FROM $this->table")->fetchColumn(0);
 // If there are no rows yet, make sure we s t a r t at 1 for thread_id
 if (! $thread_id) {
 $thread_id = 1;
 }
 $level = 0;
 $thread_pos = 0;
 }
 // i n s e r t m s g e into DB. Using prepare() and execute() makes sure that all fields are properly quoted 
 //"INSERT INTO $this->table "
 //. "($this->idname, thread_id,parent_id, thread_pos, posted_on, level, author, subject, body) "
 //.'VALUES (?,?,?,?,?,?,?,?,?)';
 $st = $this->db->prepare($this->cc_mast_or_det);
 $st->execute(array(
null, $thread_id, $parent_id, $thread_pos, date('c'), $level
,$_REQUEST['author'], $_REQUEST['subject'],$_REQUEST['body']));
 // Commit all the operations
 $this->db->commit();
 $this->inTransaction = false;
 }
 
 
 
 
 
 
 
 protected function tbl() // crud2. D I S P L A Y H I E R A R C H Y
 { //print '<h2><a href="http://dev:8083/test/books/a01cookbook/tema.php">Teme (poruka-odgovor)</a></h2>';
 // provide a way to p o s t non-reply m s g e
 // IZBORNIK t b l - i c e :
 
 // t b l h d r r o w (action menu) :
 $lnk_addmaster = '<strong>'."<a class='btn' href='".$this->curpgurl
 ."?cmd=frm_post'>Otvoriti novu temu (nit, thread)</a>"
 .'</strong> ';
 print $lnk_addmaster;
 if ('1') print '&nbsp;&nbsp;&nbsp; Help = Klik Rbr.
 &nbsp;&nbsp;&nbsp;
 |...| = | bytes|idniti, rbruniti, nivo, id, idviši| '
 .'<hr/>';

 //order m s g s by their thread (thread_id) and their position within thread (thread_pos)
 $st = $this->db->query(
 "SELECT $this->idname, subject,author"
 .",LENGTH(body) body_length,posted_on,level,thread_id,thread_pos
 ,parent_id,url"
 ." FROM $this->table ORDER BY thread_id,thread_pos");
 
 
 while ($row = $st->fetch()) {
 
 $when = date('Y-m-d H:i', strtotime($row['posted_on']));
 
 // indent m s g e s with level > 0
 print '<font style="font-family: Courier;">'
 .str_repeat('&nbsp;',2 * $row['level']) .'</font>';

 // print info about m s g with
 // - link to open page eg http://dev1:8083/01apl/04tema/tema.php
 // - link to read it
 print
 // ----------- 1. thread_id (NIT) = ORD.NO :
 ( ($row['level'] == 0) // branch root
 ?
 //'<strong>'
 // Help (msg content report) = Klik Rbr :
 "<a href='" . $this->curpgurl
 . "?cmd=frm_rpt&amp;$this->idname={$row[$this->idname]}"
 ."'>"
 . '<span class="btnsmall">'
 .'<font style="color: black; font-family: Courier;">' 
 // background-color: red; 
 .str_repeat('&nbsp;', (6 - strlen($row['thread_id'])) )
 .$row['thread_id'] //.'</strong>'
 .'</font>'
 . '</span>'
 .'</a>'
 .'. ' 
 :
 // ----------- 2. thread_pos = ORD.NO IN THREAD - Help (msg content report) = Klik Rbr u niti :
 "<a href='" . $this->curpgurl
 . "?cmd=frm_rpt&amp;$this->idname={$row[$this->idname]}"
 ."'>"
 //.'&nbsp;&nbsp;'.$row['thread_pos'].'. ' .'</strong>'
 . '<span>'
 .'<font style="color: black; background-color: white; font-family: Courier;">' 
 .str_repeat('&nbsp;', (6 - strlen($row['thread_pos'])) )
 .$row['thread_pos'] //.'</strong>'
 .'</font>'
 . '</span>'
 .'</a>'
 .'. ' 
 
 
 )
 // Klik msg to open page :
 // eg http://dev1:8083/index.php?cmd=lsweb&dir=J:\awww\apl\dev1\test\01info
 ."<a href='" . htmlentities($row['url'],ENT_QUOTES)
 ."'>"
 . htmlentities($row['subject'],ENT_QUOTES)
 .'</strong>'
 . '</a> '
 . ' by '. htmlentities($row['author'],ENT_QUOTES) . ' @ '
 . htmlentities($when,ENT_QUOTES)
 ;
 // L I N K c m d = d e l r e c
 printf('<a href="%s?cmd=delrec&'.$this->idname.'=%s'
 //.'&'.'rrgo'.'=%s'
 .'">'.'%s</a>'
 , $this->curpgurl
 , $row[$this->idname]
 //, $pgrr1
 , '<font style="color: red;">'.' |'.'</font>'
 .'BRIŠI' // d e l e t e
 .'<font style="color: red;">'.'|'.'</font>'
 );
 print " {$row['body_length']} " // bytes|
 . " |PROMJ " // u p d a t e
 ;
if ('1') print "|{$row['thread_id']},{$row['thread_pos']},{$row['level']}
,{$row[$this->idname]},{$row['parent_id']}|";
print '<br/>';

 } // e n d p r i n t r o w s
 
 print '<hr/>'.$lnk_addmaster;
 } // e n d f n t b l ( )

 
 
 
 
 protected function frm_rpt() { // crud3. R O W REPORT (m s g b o d y...)
 // make sure the m s g e i d we are passed is an integer and really represents a m s g e 
 if (! isset($_REQUEST[$this->idname])) {
 throw new Exception('Nije formirana šifra poruke');
 }
 $id = intval($_REQUEST[$this->idname]);
 //"SELECT author,subject,body,posted_on FROM $this->table WHERE $this->idname = ?";
 $st = $this->db->prepare($this->cr_byid);
 $st->execute(array($id));
 $msg = $st->fetch();
 if (! $msg) {
 throw new Exception('Loša šifra poruke');
 }
 /* don't display user-entered HTML, but display newlines as
 HTML line breaks */
 $body = str_replace('{{/strong}}','</strong>',
 str_replace('{{strong}}','<strong>',
 nl2br(htmlentities($msg['body']))
 ));
 //
 while (false !== strpos($body, '{{url}}')) {
 $beg = strpos($body, '{{url}}');
 $end = strpos($body, '{{/url}}');
 $url = substr($body, $beg+7, $end - $beg -7);
 $url2 = '<a href="'.$url.'">'.$url.'</a>'; // </strong>
 $body = str_replace('{{url}}'.$url.'{{/url}}',$url2,$body);
 //$body .= '<br />'.$url2;
 }
 //
 // display m s g e with links to reply and return to the m s g e list
 $subject = htmlentities($msg['subject']);
 $author = htmlentities($msg['author']);
 // ---------------------------------------
 // h d r m e n u f r m _ v i e w - a
 // --------------------------------------
 print<<<_HTML_
 <h2>$subject</h2>
 <h3>
 by $author &nbsp; &nbsp;
 <a href="$this->curpgurl?cmd=frm_post&parent_id=$id">Odgovor</a>
 &nbsp; &nbsp; <a href="$this->curpgurl?cmd=tbl">Stablo poruka</a>
 </h3>
 <hr/>

 <p>$body</p>

_HTML_;
 } // tbl()

 
 
 
 
 
 protected function frm_post() // crud4. ENTER USER DATA & PROCESS IT
 {
 $safe = array();
 foreach (array('author','subject','body') as $field) {

 // escape input values :
 if (isset($_POST[$field])) {
 $safe[$field] = htmlentities($_POST[$field]);
 } else { $safe[$field] = ''; }

 // make err m s g s display in red :
 if (isset($this->form_errors[$field])) {
 $this->form_errors[$field] = '<span style="color: red">' .
 $this->form_errors[$field] . '</span><br/>';
 } else { $this->form_errors[$field] = ''; }
 } // e n d f o r e a c h


 // is this m s g e reply ?
 if (isset($_REQUEST['parent_id']) &&
 $parent_id = intval($_REQUEST['parent_id'])) {
 // send parent_id along when form is submitted
 $parent_field = sprintf(
 '<input type="hidden" 
 name="parent_id" 
 value="$this->idname" />'
 , $parent_id);
 // if no subject's been passed in, use parent's subject
 if (! strlen($safe['subject'])) {
 //"SELECT subject FROM $this->table WHERE $this->idname = ?";
 $st = $this->db->prepare($this->cr_byid_colname);
 $st->execute(array($parent_id));
 $parent_subject = $st->fetchColumn(0);
 /* prefix 'Re: ' to parent subject if it exists and
 doesn't already have 'Re:' */
 $safe['subject'] = htmlentities($parent_subject);
 if ( $parent_subject
 && (! preg_match('/^re:/i',$parent_subject)))
 { $safe['subject'] = "Re: {$safe['subject']}"; }
 }
 } else { $parent_field = ''; }


 // display posting form, with errors and default values
 print<<<_HTML_
 <form method="post" action="$this->curpgurl">
 <table>
 <tr>
 <td>Your Name:</td>
 <td>{$this->form_errors['author']}
 <input type="text" name="author" value="{$safe['author']}" />
 </td>
 <tr>
 <td>Subject:</td>
 <td>{$this->form_errors['subject']}
 <input type="text" name="subject" value="{$safe['subject']}" />
 </td>
 <tr>
 <td>Poruka:</td>
 <td>{$this->form_errors['body']}
 <textarea rows="4" cols="30" wrap="physical"
 name="body">{$safe['body']}</textarea>
 </td>
 <tr><td colspan="2"><input type="submit" value="Pošaljite poruku" /></td></tr>
 </table>
 $parent_field
 <input type="hidden" name="cmd" value="crerec" />
 </form>
_HTML_;
}



 // B A C K E N D - administrator actions :
 protected function delrec($parent_id) { // crud5 BACKEND D ELETE R OW
 //$parent_id = isset($_REQUEST[$this->idname]) ? intval($_REQUEST[$this->idname]) : 0;
// $this->idval_url
//basename(__FILE__).' SAYS'.'<br>'.'$id'.'=='.$parent_id.'=='
if ('') $this->utl->phpjsmsg('***** '.__FUNCTION__.'() SAYS: ' 
 .'<br>'.'$dml=***'.$this->cdel_row_byid.'***<br>'.'?=$parent_id=***'
 .$parent_id.'***');
 // is this m s g e a reply?
 if ($parent_id) {
 // Make sure m s g e doesn't change while we're working with it.
 $this->db->beginTransaction();
 $this->inTransaction = true;
 //"DELETE FROM $this->table WHERE $this->idname=?"; //$values[]=$parent_id;
 $st = $this->db->prepare($this->cdel_row_byid);
 //or $this->db->get_con()->prepare ?
 $st->execute(array($parent_id));
 // fetchAll() is needed only for s e l e c t 
 //Commit all the operations
 $this->db->commit();
 $this->inTransaction = false;
 } 
 }

 
 
 
 



 // 5. makes sure something is entered in each field :
 protected function valid() {
 $this->form_errors = array();
 // R E Q U I R E D U S E R D A T A :
 if (! (isset($_POST['author']) && strlen(trim($_POST['author'])))) {
 $this->form_errors['author'] = 'Upišite vaše ime (autor).';
 }
 if (! (isset($_POST['subject']) && strlen(trim($_POST['subject'])))) {
 $this->form_errors['subject'] = 'Upišite naslov poruke.';
 }
 if (! (isset($_POST['body']) && strlen(trim($_POST['body'])))) {
 $this->form_errors['body'] = 'Upišite tekst poruke.';
 }
 return (count($this->form_errors) == 0);
 }

 // 6.
 protected function logAndDie(Exception $e) {
 print 'ERROR: ' . htmlentities($e->getMessage());
 if ($this->db && $this->db->inTransaction()) {
 $this->db->rollback();
 }
 exit();
 }
 
 
 
 
 
} // e n d c l a s s



// <strong><a href="http://...">http://...</a></strong>
// if (false !== strpos($string, $substring)) { /* found it! */ }
// if (strpos($haystack, $needle) !== false) echo 'match!';
// $withoutCommas = is_numeric(str_replace(',', '', $number));

/*
ALTER TABLE message RENAME TO sqlitestudio_temp_table;

CREATE TABLE message (
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 subject CHAR (255),
 url VARCHAR (500),
 thread_id [INT UNSIGNED] NOT NULL,
 thread_pos [INT UNSIGNED] NOT NULL,
 level [INT UNSIGNED] NOT NULL,
 parent_id [INT UNSIGNED] NOT NULL,
 author CHAR (255),
 body MEDIUMTEXT,
 posted_on DATETIME NOT NULL
);

INSERT INTO message (
id
,subject
,url
,thread_id
,thread_pos
,level
,parent_id
,author
,body
,posted_on
)
SELECT
id
,subject
,url
,thread_id
,thread_pos
,level
,parent_id
,author
,body
,posted_on
FROM sqlitestudio_temp_table;

DROP TABLE sqlitestudio_temp_table;




 TO INCLUDE RESULTS OF EXECUTING FN OR EXPRESSION WITHIN A STRING
 You can put vars, obj.prop, array el. (if subscript is unquoted) directly in double-quoted strings:

 eg print "You owe $amounts[payment] immediately.";
 eg print "My circle's diameter is $circle->diameter inches.";

 Curly braces around more complicated expressions to interpolate them into a string:

 print "I have {$children} children.";
 print "You owe {$amounts['payment']} immediately.";
 print "My circle's diameter is {$circle->getDiameter()} inches.";

 Direct interpolation or string concat. also works with heredocs:
 print <<< END
 Right now, the time is
 END
 . strftime('%c') . <<< END
 but tomorrow it will be
END
 . strftime('%c',time() + 86400);

 
 {{url}} http://dev1:8083/my_dev/pdo/tema/tema.php {{/url}}
 J:\awww\apl\dev1\my_dev\pdo\tema\tema.php
 J:\dev_web\htdocs\test\books\a01cookbook\tema.php


Promjene podataka programom J:\aplp\aplp\sqlitestudio\SQLiteStudio.exe

SELFJOIN TABLE :
 1. C INSERT frm data,
 2. R DISPLAY tbl, row,
 3. V VALIDATE, E set_exception_handler
Not neccessarily here:
U UPDATE and D DELETE WITH J:\aplp\aplp\sqlitestudio\SQLiteStudio.exe

*/

1. Install Apache, PHP, Oracle DB 11g XE & 11g, Oracle Forms 6i and 12c & Reports on Win 10 (all 64bit)

HOME   Downloads are now:  https://github.com/slavkoss/fwphp

26.oct.2019 I use 64 bit XAMPP: PHP 7.3.7 AND APACHE 2.4.38. on Windows 10 64 bit. PDO: mysql, oci, sqlite ARE WORKING.Oracle db 11gXE (no more E. Rangel pdooci – pdo sintax on oci8 program layer).

I tried 4-5 WAMP server SW WAMP and ZWAMP are ok but XAMPP unzip is  simplest – almost 1 click . WAMP has problem with composer installations from Windows command line. Next shows more details (I do not use ZWAMP recently) :

  1. Unzip zwamp-x64-2.2.1-full.zip to J:\zwamp64
  2. Rename old J:\zwamp64\vdrive\.sys\Apache2 dir to Apache2_2_4_16
  3. Download Apache : http://www.apachelounge.com
    Create dir J:\zwamp64\vdrive\.sys\Apache2.
    Unzip httpd-2.4.20-win64-VC14.zip – it’s Apache24 folder content to :
    ServerRoot J:/zwamp64/vdrive/.sys/Apache2 (or c:/Apache24 = ServerRoot) in httpd.conf
    Default folder for your your webpages is DocumentRoot
    DocumentRoot J:/zwamp64/vdrive/.sys/Apache2/htdocs
    Directories
    ScriptAlias – also when you use extra folder config file(s) change to your location there
  4. No changes in J:\zwamp64\vdrive\.sys\Apache2_2_4_16\conf\extra
  5. changes in J:\zwamp64\vdrive\.sys\Apache2\conf :
    copy here own httpd.conf ver 2.4.16 to conf dir (rename original before copying)
    copy here own vhosts.conf ver 2.4.16 to conf dir
  6. J:\zwamp64\vdrive\.sys\Apache2\conf\httpd.conf :
    LoadModule php7_module /.sys/php/php7apache2_4.dll
    AddType application/x-httpd-php .php# without this OCI8 and PDO MySQL and PDO sqlite are not visible in inet browser
    are visible in php CLI
    PHPIniDir /.sys/php
  7. Download PHP:  http://windows.php.net/download/
    php-7.0.8-Win32-VC14-x64.zip
     same unzip as apache zip above.
  8. Downloadnewest oci8-2.1.1 Extension for php 7.0.8 64 bit on Windows 10 64 bit – april 2016 (older does not work) :
    OCI8 is also for E.Rangels PDOOCI.
    https://pecl.php.net/package/oci8/2.1.1/windows  – Windows dll-s
    https://pecl.php.net/package/oci8   – for Linux
    released by [email protected]
    https://blogs.oracle.com/opal/entry/php_7_oci8_2_1
    php_oci8-2.1.1-7.0-ts-vc14-x64_Jones_pecl.php.net.zip
    Unzip it’s dll-s to: 
    J:\zwamp64\vdrive\.sys\php\ext
    Christopher Jones’s oci8-2.1.1 for php 7 :
    dir J:\zwamp64\vdrive\.sys\php\ext\php_oci*.*
    18.04.2016.  05:20   155.136 php_oci8.dll
    18.04.2016.  05:20   790.528 php_oci8.pdb – WHAT IS THIS ?
    18.04.2016.  05:20   157.184 php_oci8_11g.dll
    18.04.2016.  05:20   790.528 php_oci8_11g.pdb
    18.04.2016.  05:20   158.208 php_oci8_12c.dll
    18.04.2016.  05:20   790.528 php_oci8_12c.pdb
    7 File(s)      2.997.248 bytes
  9. J:\zwamp64\vdrive\.sys\php\php.ini
  10. 2click J:\zwamp64\zwamp.exe -> right click house icon -> restart
    -> started Apache and MySQL. If not both started very useful is :
    J:\zwamp64\vdrive\.sys\Apache2\bin>httpd.exe
    – this report errors, same as :
    php -v
    PHP 7.0.8 (cli) (built: Jun 21 2016 15:15:15) ( ZTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    or
    php -r “var_dump(function_exists(‘oci_connect’));”
    or
    C:\WINDOWS\system32>php -r “if (! $dbc = oci_pconnect(‘hr’, ‘hr’, ‘ora7’, ‘UTF8’)) echo ‘***** 1. UNSUCCESSFULL db connect *****’; else {echo \”\n\”; echo ‘~~~~~~~~~~~  PARSE-BIND-EXECUTE-FETCH ~~~~~~~~~~’; echo \”\n\”; echo ‘SUCCESSFULL db connect’; echo \”\n\”;  $dml=’SELECT first_name, phone_number FROM (SELECT first_name, phone_number FROM employees ORDER BY first_name) where rownum < 3′; echo $dml; echo \”\n\”; $parse_stid = oci_parse($dbc, $dml);  if (!$parse_stid) {   $m = oci_error($conn);    echo ‘skripta: ‘ . __FILE__ ;   echo’ says neuspio oci_parse : ‘ ;   echo $m[‘message’]; }   $exec_ret =  oci_execute($parse_stid);       echo ‘oci_execute returned: ‘;     print_r($exec_ret);        echo \”\n\”; echo ‘oci_fetch_array returned: ‘;  $row = oci_fetch_array($parse_stid, OCI_ASSOC + OCI_RETURN_NULLS); print_r($row); }”WHICH DISPLAYS:~~~~~~~~~~~  PARSE-BIND-EXECUTE-FETCH ~~~~~~~~~~
    SUCCESSFULL db connect
    SELECT first_name, phone_number FROM (SELECT first_name, phone_number FROM employees ORDER BY first_name) where rownum < 3
    oci_execute returned: 1
    oci_fetch_array returned: Array
    (
    [FIRST_NAME] => Adam
    [PHONE_NUMBER] => 650.123.2234
    )
  11. Not needed if we use ZWAMP :
    Install Apache as a service:
    httpd.exe -k install   httpd.exe -k restart, or stop
    ApacheMonitor: (not needed if we use ZWAMP):
    Double click ApacheMonitor.exe, or put it in your Startup folder.

 

 

28.11.2015 INSTALLATION APACHE 2.4.16 (Win64)  & PHP 7.0.0 RC5 MSVC14 (Visual C++ 2015) x64 ON J:\zwamp\vdrive\.sys\Apache2 (& …\php) OR ON C DISK

Install as a service (not needed if using XAMPP or ZWAMP or WAMP):
httpd.exe -k install
httpd.exe -k  restart

httpd.exe -k stop  
ApacheMonitor: Double click ApacheMonitor.exe, or put it in your Startup folder.

Use PGP Signature and/or the SHA Checksums to verify the integrity.
C:\gnuwin32\bin\sha1sum.exe -help
sha1sum.exe -b J:\0downl\1_instalirano\Apache_httpd-2.4.16-win64-VC14.zip :
d917094cf13ecea83938aa58058ea7c5c6ef2756
Checksums created with GPGHash by SmartJuwel
Creation date: 22.07.2015 with GnuPG Version: 1.4.18
SHA1-Checksum for: httpd-2.4.16-win64-VC14.zip:
D917094CF13ECEA83938AA58058EA7C5C6EF2756
or SHA224-Checksum or SHA256-Checksum or SHA384-Checksum

php http://windows.php.net/qa/ For Apache on Windows: Thread Safe

I did not used Instant Client :
Oracle Database drivers for popular languages and environments including Node.js, Python and PHP can use Instant Client to connect to local or remote DBs.
https://community.oracle.com/thread/1051752 :
1. Download 64 or 32-bit Oracle Instant Client – there is no MSVC14 build 6.8.2015
2. put it somewhere useful (I put it under my php directory)
3. Add it to your system’s PATH. (A quick & dirty fix on Windows is to copy
all of the *.dll files   from the 11g InstantClient package* into same dir
as your webserver’s executable (e.g. httpd.exe).)
http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html
4. Edit your php.ini and uncomment extension=php_oci8_11g.dll

I did not 1. to 4. above !

Stories on WEB that excellent (but never finished and abandoned) old 32 bit F6i, R6i SW and new Windows do not work together are not true. See also – they managed same as I (good site, could give more details):
Installing Oracle Developer (forms & reports 6i) on Windows 7 64bit
and
Oracle Developer 6i & Oracle database 11g R2 (11.2.0.1.0)
Great question to Oracle who says “we do not leave our customers who still use F6i & R6i” – but F6i & R6i can not even be downloaded from Oracle:
Why 32 bit F6i & R6i can not be patched to be certificated on 64 bit 11g and 64 bit Windows ? Oracle Power Objects (SW simmilar to F6i & R6i ) is also abandoned SW.
Today is modern to make new SW, worse than old (nobody begins new project with F11 & R11 – they are rather applications than development SW) and forget poor bastards who bought abandoned SW. So they cut their expenses (and our lifes). Simmilar stories are Microsoft ASP-VS2008-Silverlight, Google AngularJS 1.x – 2.x, over 100 development SW around…
Incompetent managers and trade departments cut our lifes, but they should know that life is not child joke.

APACHE – USE THREAD SAFE (TS) VERSIONS OF PHP BINARIES FOR WINDOWS
MULTITHREAD CAPABLE BINARIES BUILDS – INTERACTION WITH A MULTITHREADED SAPI AND PHP LOADED AS A MODULE INTO A WEB SERVER.

Use Apache builds provided by Apache Lounge – PHP official site use their binaries to build Apache SAPIs.

VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed.
VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012  x86 or x64 installed. and so on

PECL FOR WINDOWS:PECL extensions for Windows is being worked on. Windows DLL can be downloaded right from thePECL website.
PECL extension release and snapshot build directories are browsable directly.

Not needed for 64 bit Apache, PHP, 11XE all three on home PC..
Download from http://www.oracle.com/technetwork/topics/winx64soft-089540.html
instantclient-basic-windows.x64-12.1.0.1.0.zip (64,939,911 bytes) (cksum – 3658834848)
extract to:  C:\Windows\SysWOW64\instantclient_12_1
and set it on Win PATH variable + H:\Apache24\bin,
(NO:    THERE ARE MORE PHP INSTALLATIONS  (only 1 Apache):    + H:\php)

C:\Apache24\bin>echo %SystemRoot%
outputs: C:\Windows

C:\Apache24\bin>path

extension=php_oci8_11g.dll (remove the “;” from the start of the line)

Restart Apache (XAMPP or WAMP server)

Open  file to see database name as
C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\tnsnames.ora
// D:\app\Farhan\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora

LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.168.1.2)
)
)

Service name is “orcl.168.1.2”,  my is: XE :

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sspc)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  ) 
ora7 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sspc)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  ) 
EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

See  https://github.com/slavkoss/fwphp/blob/master/fwphp/glomodul/z_examples/index.php
for  httpd.conf, vhosts.conf, C:\Windows\System32\drivers\etc\hosts, php.ini