Install PHP with MacPorts on Mac Big Sur

Install MacPorts based on your mac version.
pls see https://www.macports.org/install.php

if you have already MacPorts, pls update/upgrade it:

Install PHP7.4
read: https://ports.macports.org/port/php74/

run: sudo port install php74
install some php7.4 extension: sudo port install php74-apache2handler php74-cgi php74-gd php74-curl php74-intl php74-iconv php74-gettext php74-mbstring php74-imap php74-mcrypt php74-xmlrpc php74-mysql php74-openssl php74-sockets php74-zip php74-tidy php74-opcache php74-xsl php74-sqlite php74-xdebug

Select php74 as the active PHP version:
sudo port select php php74

check:
php -v
PHP 7.4.33 (cli) (built: Oct 13 2024 09:21:46) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
with Xdebug v3.1.6, Copyright (c) 2002-2022, by Derick Rethans

Install Apache2
check apache2: (the default apache2 from mac)
[codesyntax lang=”bash”]

[/codesyntax]

read: https://trac.macports.org/wiki/howto/Apache2

verify the config file:
[codesyntax lang=”bash”]

[/codesyntax]

Activate apache2 :
sudo port load apache2

to remove the warning:
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using Satrias-MacBook-Pro.local. Set the ‘ServerName’ directive globally to suppress this message
edit /opt/local/etc/apache2/httpd.conf –> should use admin to edit it
Open geany as admin via command line: sudo “/Applications/Geany.app/Contents/MacOS/geany”
then add this line:
ServerName localhost:80
then unload and load again apache2:
sudo port unload apache2
sudo port load apache2
then
[codesyntax lang=”bash”]

[/codesyntax]

Test it on the browser: http://localhost/ –> it should work

Link PHP7.4 with apache2
read: https://trac.macports.org/wiki/howto/MAMP
Go to this dir:
cd /opt/local/lib/apache2/modules
then run:
[codesyntax lang=”bash”]

[/codesyntax]

then modify /opt/local/etc/apache2/httpd.conf, so it’ll be:
DirectoryIndex index.php index.html

 

Local Install Typo3 Version 12

Download the file on https://get.typo3.org/version/12 (Typo3 Version 12.4.28). I downloaded the .tar.gz file
Uncompress the downloaded file then move to the web root and rename to ‘typo3-12.4.28’

CREATE LOCAL SETUP

CREATE A CONF

CONTENT

ENABLE THE VIRTUALHOST

RELOAD APACHE2

CREATE THE HOST

RELOAD APACHE2 AGAIN

SET THE FILE PERMISSION

ALSO MODIFY FILE _.htaccess TO .htaccess

OPEN: http://typo3-12.4.28.test/
INSTALL
FOR THE FIRST INSTALL, CREATE A NEW FILE WITH NAME ‘FIRST_INSTALL’ IN THE TYPO3 ROOT. SO THE FILE PATH WOULD BE LIKE THIS: ~/Documents/projects/typo3-12.4.28/FIRST_INSTALL
CREATE A NEW DATABASE ‘typo3_12_4_28’

http://typo3-12.4.28.test/typo3
ADMIN
user: admin
pass: Teddy@123

FIRST OPEN http://typo3-12.4.28.test/, I GOT THIS ERROR

ALSO ON THE ADMIN PAGE (LOG)
SOLUTION:
THAT’S BECAUSE I HAVEN’T INSTALLED ANY DISTRIBUTION PACKAGES. ON THE INSTALLATION, I CHOOSE EMPTY PACKAGE!
READ: https://hostarmada.com/tutorials/blog-cms/typo3/how-to-troubleshoot-the-no-pages-are-found-on-the-rootlevel-error-after-initial-typo3-installation/
SO I NEED TO INSTALL THE OFFICIAL DISTRIBUTION PACKAGE JUST TO SHOW ANY DATA ON THE WEBSITE
OPEN AGAIN: http://typo3-12.4.28.test/
NOW SHOULD BE NO ERROR

Install xdebug with PHP 8.2 on Ubuntu 22.04

<OLD>Ref: https://gist.github.com/henryonsoftware/066d8282daaf8c2ae281ce010e3e5404

1. Download xdebug source code from https://github.com/xdebug/xdebug/releases
for example the xdebug 3.3.2 from https://github.com/xdebug/xdebug/archive/refs/tags/3.3.2.tar.gz

2. extract the downloaded file
satria@teddy:~$ cd Downloads/
satria@teddy:~/Downloads$ tar -xvzf xdebug-3.3.2.tar.gz

3. run ‘phpize’
satria@teddy:~/Downloads$ cd xdebug-3.3.2/
satria@teddy:~/Downloads/xdebug-3.3.2$ phpize
Configuring for:
PHP Api Version: 20210902
Zend Module Api No: 20210902
Zend Extension Api No: 420210902
configure.ac:165: warning: The macro `AC_PROG_LIBTOOL’ is obsolete.
configure.ac:165: You should run autoupdate.
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from…
configure.ac:165: the top level

4. run ‘./configure’
satria@teddy:~/Downloads/xdebug-3.3.2$ ./configure

5. run ‘make’
satria@teddy:~/Downloads/xdebug-3.3.2$ make

6. copy the module xdebug.so to php lib 20210902
</OLD>
<NEW>

Use php from repository ppa:ondrej/php
then install php8.2-dev
[codesyntax lang=”php”]

[/codesyntax]

then install php8.2-xdebug
[codesyntax lang=”php”]

[/codesyntax]

check the php version
[codesyntax lang=”php”]

[/codesyntax]

if not php8.2, you can select it by using
[codesyntax lang=”php”]

[/codesyntax]

CONFIG XDEBUG

SETTING

 

Local Install SMF (Simple Machines Forum)

Download the latest file on https://download.simplemachines.org/

CREATE LOCAL SETUP

CREATE A CONF

CONTENT

ENABLE THE VIRTUALHOST

RELOAD APACHE2

CREATE THE HOST

RELOAD APACHE2 AGAIN

SET THE FILE PERMISSION

OPEN: http://smf_2-1-4.test/

Admin
user: admin
pass: Teddy@123

Local Install Typo3 Version 8

Download the file on https://get.typo3.org/version/8.7.32 (Typo3 Version 8.7.32). I downloaded the .tar.gz file
Uncompress the downloaded file then move to the web root and rename to ‘typo3-8.7.32’

CREATE LOCAL SETUP

CREATE A CONF

CONTENT

ENABLE THE VIRTUALHOST

RELOAD APACHE2

CREATE THE HOST

RELOAD APACHE2 AGAIN

SET THE FILE PERMISSION

ALSO MODIFY FILE _.htaccess TO .htaccess

OPEN: http://typo3-8.7.32.test/
INSTALL
FOR THE FIRST INSTALL, CREATE A NEW FILE WITH NAME ‘FIRST_INSTALL’ IN THE TYPO3 ROOT. SO THE FILE PATH WOULD BE LIKE THIS: ~/Documents/projects/typo3-8.7.32/FIRST_INSTALL
CREATE A NEW DATABASE ‘typo3_8_7_32’

http://typo3-8.7.32.test/typo3
ADMIN
user: admin
pass: Teddy@123

FIRST OPEN http://typo3-8.7.32.test/, I GOT THIS ERROR

ALSO ON THE ADMIN PAGE (LOG)
SOLUTION:
THAT’S BECAUSE I HAVEN’T INSTALLED ANY DISTRIBUTION PACKAGES. ON THE INSTALLATION, I CHOOSE EMPTY PACKAGE!
READ: https://hostarmada.com/tutorials/blog-cms/typo3/how-to-troubleshoot-the-no-pages-are-found-on-the-rootlevel-error-after-initial-typo3-installation/
SO I NEED TO INSTALL THE OFFICIAL DISTRIBUTION PACKAGE JUST TO SHOW ANY DATA ON THE WEBSITE
OPEN AGAIN: http://typo3-8.7.32.test/
NOW SHOULD BE NO ERROR

Tiki Wiki

Download the package in https://tiki.org/Get-Tiki

INSTALL
1. extract the downloaded (at the time the file is tiki-24.6 (LTS) and tiki-26.2.tar.gz) cms in your web root directory
2. setup a local apache virtual host

CONFIG FILE

CONTENT

ENABLE THE VIRTUALHOST

RELOAD APACHE2

CREATE THE HOST

RELOAD APACHE2

CHANGE PERMISSION FOR  THESE FILES AND DIRECTORIES

OPEN http://tiki-24.6.test/
ADMIN
email: advcha@yahoo.com
username: admin
password: Teddy@123

Concrete CMS

Download the latest version from https://www.concretecms.org/download

INSTALL
1. extract the downloaded (at the time the file is concrete-cms-9.2.5.zip) cms in your web root directory
2. setup a local apache virtual host
Create a new database ‘concrete_cms’

CONFIG FILE

CONTENT

ENABLE THE VIRTUALHOST

RELOAD APACHE2

CREATE THE HOST

RELOAD APACHE2

CHANGE PERMISSION FOR  THESE FILES AND DIRECTORIES

OPEN http://concrete-cms-9.2.5.test/
ADMIN
email: advcha@yahoo.com
password: Teddy@123

Install PHP 5.6 On Ubuntu 20.04

REF: https://tecadmin.net/install-php-ubuntu-20-04/

I already added Ondřej Surý PPA repository. So Just install php5.6

Check it on CLI Terminal

A few extensions are already installed automatically

So installed some others extensions

Install XDebug

Check it out

PHP5.6 On Apache2
Disable the old PHP

Enable PHP5.6

Also need to run — NO NEED

Restart Apache server

Check on the browser

Should show like PHP Version 5.6.40-65+ubuntu20.04.1+deb.sury.org+1

CHANGE THE PHP5.6 SETTING
MODIFY SOME INI FILES IN:
/etc/php/5.6/fpm/php.ini  –> PHP-FPM  AS MAIN
/etc/php/5.6/apache2/php.ini  –>APACHE
/etc/php/5.6/cli/php.ini –> CLI

RESTART

DONE

Install PHP 8.1 On Ubuntu 20.04 (Apache and Nginx)

REF: https://computingforgeeks.com/how-to-install-php-on-ubuntu-linux-system/

I already added Ondřej Surý PPA repository. So Just install php8.1

The apache module and cli for php8.1 is included

Check it on CLI Terminal

Then install the extensions.

Install XDebug

Check

PHP8.1 On Apache2
Disable the old PHP

Enable PHP8.1

Also need to run

Restart Apache server

Check on the browser

Should show like PHP Version 8.1.6

CHANGE THE PHP8.1 SETTING
MODIFY SOME INI FILES IN:
/etc/php/8.1/fpm/php.ini  –> PHP-FPM  AS MAIN
/etc/php/8.1/apache/php.ini  –>APACHE
/etc/php/8.1/cli/php.ini –> CLI

RESTART

FOR PHP FPM

TO USE PHP8.1 WITHOUT FPM, PLS STOP PHP8.1 FPM

ALSO DISABLE SOME FPM MODULES (mpm_event)

IF NEEDED

THEN ENABLE mpm_prefork

RELOAD

NOW IT’D BE RUNNING

USE NGINX and PHP8.1-FPM
STOP APACHE2

INSTALL NGINX

MODIFY THE DEFAULT CONF

THEN ADD ‘index.php’ SO THE PHP FILE WOULD BE EXECUTED NOT DOWNLOADED.
ALSO UNCOMMENT ‘include snippets/fastcgi-php.conf;’ AND ‘fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;’ AND ‘location ~ /\.ht{…}’

CHECK SETTING: sudo nginx -t
RELOAD NGINX

SOMETIMES IT’D NEED TO RESTART/LOGOFF THE COMPUTER!!!
CHECK ON

CONFIGURE PHPMYADMIN WITH NGINX
MODIFY /etc/nginx/sites-available/default

THEN ADD:

RELOAD NGINX
OPEN PHPMYADMIN: http://localhost/phpmyadmin

Install Magento 2.4.0 on Ubuntu 18.04

Ref: https://www.rosehosting.com/blog/how-to-install-magento-2-4-with-lemp-stack-on-ubuntu-20-04/

Requirements: PHP7.4, Nginx/Apache2, MySQL, ElasticSearch

CHECK PHP VERSION. IF NOT PHP7.4, INSTALL/CHANGE IT TO 7.4

FIND OUT IF THERE IS PHP7.4 INSTALLED OR NOT

IT SEEMS I HAVEN’T INSTALLED PHP7.4 YET (BUT I FOUND IT ON /etc/php/7.4). IT MEANS IT ALREADY INSTALLED BUT IT DIDN’T HAVE THE OTHERS MODULES (PHP-FPM, ETC). SO INSTALL THEM

NOTE: I HAVE TO INSTALL THEM VIA TELKOMSEL FLASH BECAUSE INDIHOME CAN’T INSTALL THEM!
CHECK AGAIN THE AVAILABLE PHP AND MAKE SURE PHP7.4 IS INSTALLED THEN SELECT IT

NOW

THEN CHANGE PHP7.4-FPM SETTING:

CHANGE THE CONTENT:

THEN RESTART PHP7.4-FPM SERVICE:

CHECK NGINX SYNTAX: sudo nginx -t
RESTART NGINX: sudo systemctl restart nginx
OPEN IT: http://localhost/phpinfo.php (NEED TO CLEAR THE BROWSER CACHE FIRST)
IF YOU CAN’T OPEN http://localhost/phpinfo.php PROPERLY, PLS MAKE SURE THE NGINX CONFIGURATION FILE IS CORRECT

MAKE SURE THE ‘DEFAULT’ PORT IS 80 NOT 8080 AND THE PHP-FPM POINT TO PHP7.4

OKAY. DON’T FORGET TO RESTART NGINX SERVICE

THE CURRENT PHP VERSION FOR FPM IS 7.4.12

CHECK STATUS ELASTICSEARCH

IF IT’S NOT ACTIVE OR DISABLED, THE START THE SERVICE

THEN CHECK THE ELASTICSEARCH VERSION BY OPENING THE PORT 9200 ON THE BROWSER: http://localhost:9200/
HERE IS THE FINE RESULT

INSTALL MAGENTO 2.4 VIA COMMAND LINE — AVOID THIS BECAUSE SOMEHOW I GOT THE ‘DEV’ VERSION NOT STABLE VERSION. SO IT’D BE BETTER TO DOWNLOAD THE ARCHIVE HERE https://magento.com/tech-resources/download
CREATE A NEW DIR ‘magento24’ THEN USE GIT CLONE TO GET THE MAGENTO CODE (NOTE: IT TOOK A WHILE)

RUN ‘composer install’

BUT I GOT THIS ERROR

IT SEEMED I FORGOT TO INSTALL php-soap (THERE IS NO php7.4-soap). INSTALL IT

THEN ENABLE IT IN ‘/etc/php/7.4/cli/php.ini’ AND ‘/etc/php/7.4/fpm/php.ini’. FOR EXAMPLE

THEN UNCOMMENT

DON’T FORGET TO RESTART NGINX
CHECK IT

ALSO CHECK IT ON http://localhost/phpinfo.php
IF EVERYTHING ALRIGHT, RERUN ‘composer install’
IF EVERYTHING ALRIGHT, THEN CREATE A NEW DATABASE ‘magento24’ WITH COLLATION ‘utf8mb4_unicode_520_ci’ THEN RUN THIS:

MAKE SURE EVEYTHING IS FINE

Change the ownership of the magento2 directory to www-data with the following command:

THEN CREATE NGINX CONFIG FILE

The content:

Then

Then

Then insert

CHECK THE NGINX AND RESTART

IF NEEDED SET THE FILE PERMISSION and ownership

COMPILE

BUT WHEN I OPENED IT ON THE BROWSER http://magento24.test/
I GOT 404 ERROR.
FROM THE /var/log/nginx/error, I FOUND

I TRIED TO COPY index.php FILE INTO THE magento24 DIR. IT’S WORKING BUT IT FAILED TO LOAD THE STATIC FILES (CSS, JS, ETC) SO I THINK I’LL INSTALL IT VIA FILE DOWNLOADED ON https://magento.com/tech-resources/download
IT SEEMS THE COMMAND LINE INSTALLED THE DEV VERSION


INSTALL FROM THE DOWNLOADED FILE (ALSO READ http://myprojects.advchaweb.com/index.php/2019/02/26/install-magento-2-3-on-ubuntu-16-04-and-nginx/)
BUT STUCK ON http://magento24.test/setup/#/landing
CAN’T FIND ANY BUTTON TO CONTINUE!!!