21

How to change PHP version in XAMPP on Mac

 1 year ago
source link: https://aungkoman.github.io/2023/04/10/how-to-change-php-version-in-xampp-mac.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to change PHP version in XAMPP on Mac

I need to change default php 8.2 come with XAMPP latest version to 8.0.2 which we’re running on production server.

brew install [email protected]

msd@MSDs-Mac-mini base % php -v PHP 8.1.17 (cli) (built: Mar 16 2023 13:07:08) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.17, Copyright (c) Zend Technologies with Zend OPcache v8.1.17, Copyright (c), by Zend Technologies msd@MSDs-Mac-mini base % composer install Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Nothing to install, update or remove Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover –ansi

INFO Discovering packages.

barryvdh/laravel-debugbar ……………………………………………………………………………………………………. DONE kreait/laravel-firebase ……………………………………………………………………………………………………… DONE laravel/passport ……………………………………………………………………………………………………………. DONE laravel/sail ……………………………………………………………………………………………………………….. DONE laravel/sanctum …………………………………………………………………………………………………………….. DONE laravel/telescope …………………………………………………………………………………………………………… DONE laravel/tinker ……………………………………………………………………………………………………………… DONE livewire/livewire …………………………………………………………………………………………………………… DONE nesbot/carbon ………………………………………………………………………………………………………………. DONE nunomaduro/collision ………………………………………………………………………………………………………… DONE nunomaduro/termwind …………………………………………………………………………………………………………. DONE opcodesio/log-viewer ………………………………………………………………………………………………………… DONE spatie/laravel-ignition ……………………………………………………………………………………………………… DONE

103 packages you are using are looking for funding. Use the composer fund command to find out more! msd@MSDs-Mac-mini base % brew install [email protected] Running brew update --auto-update… ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations

==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae aarch64-elf-gdb dexter hz llvm@15 opal trurl wxlua aliyunpan enchive imessage-exporter mdt [email protected] trust-dns zpaqfranz arjun flavours kitex musikcube renovate tt blocky gat ksops notify streamvbyte typst cloudpan189-go go-feature-flag-relay-proxy libansilove ntfy thriftgo wazero ==> New Casks alipay-key-tool beardie cursor edrawmind mullvad-browser orbstack piclist usmart-trade zed archaeology carbide-create dehelper hummingbird nozbe orcaslicer stack vbrokers

You have 5 outdated formulae installed.

Warning: [email protected] has been deprecated because it is a versioned formula! ==> Fetching dependencies for [email protected]: apr, zstd, freetds, openexr and sqlite ==> Fetching apr ==> Downloading https://ghcr.io/v2/homebrew/core/apr/manifests/1.7.3 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/apr/blobs/sha256:3697f4c0227f5ffbe41d20c423c4ef730f32aafa70b52865704cd8a1e1220c26 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:3697f4c0227f5ffbe41d20c423c4ef730f32aafa70b52865704cd8a1e1220c26?se=2023-04-10T04%3A45%3A00Z&sig=toBRYV4C6DXPcQtobIemtBBwJ8lNK9ADvCnE2K88Zww% ######################################################################## 100.0% ==> Fetching zstd ==> Downloading https://ghcr.io/v2/homebrew/core/zstd/manifests/1.5.5 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/zstd/blobs/sha256:b709835f4cd5d339b97103f0dfa343489a02d2073f8e80ba7b04d682f1d29bd4 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:b709835f4cd5d339b97103f0dfa343489a02d2073f8e80ba7b04d682f1d29bd4?se=2023-04-10T04%3A45%3A00Z&sig=wynErbldkC0AfsM%2FFiIDIA4knFElvCOYZFqxVdtW94 ######################################################################## 100.0% ==> Fetching freetds ==> Downloading https://ghcr.io/v2/homebrew/core/freetds/manifests/1.3.18 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/freetds/blobs/sha256:3121d9240917d0efb691d437cd1973123822b0c0fe4197aa9706622588228835 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:3121d9240917d0efb691d437cd1973123822b0c0fe4197aa9706622588228835?se=2023-04-10T04%3A45%3A00Z&sig=vtGcwx9Hsao4q2NT1J3kSFvdGT5n6FNQRhxL5OIx1aY% ######################################################################## 100.0% ==> Fetching openexr ==> Downloading https://ghcr.io/v2/homebrew/core/openexr/manifests/3.1.7 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/openexr/blobs/sha256:af3bf3c18721d74bd6e3ae7ca18af940b18d598539b69f5872e2d5e130f6e83c ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:af3bf3c18721d74bd6e3ae7ca18af940b18d598539b69f5872e2d5e130f6e83c?se=2023-04-10T04%3A45%3A00Z&sig=Sq3eqR4Txxs036d73XIsgo%2ByPLDTUkUvt25k3G8ons ######################################################################## 100.0% ==> Fetching sqlite ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.41.2 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:2a77f2ddcf124d8704c299572c4dc55517996d796011545852e362c6e2a2a2ea ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:2a77f2ddcf124d8704c299572c4dc55517996d796011545852e362c6e2a2a2ea?se=2023-04-10T04%3A45%3A00Z&sig=6x7DpD%2F2gtTBKvnTZoUidb2jujozug4hEVrU0E%2Fx ######################################################################## 100.0% ==> Fetching [email protected] ==> Downloading https://ghcr.io/v2/homebrew/core/php/8.0/manifests/8.0.28 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/php/8.0/blobs/sha256:fdff1a7af1220afe62fca6cdc859ec00b72382b7ef14e3cad54cfea8628a5be8 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:fdff1a7af1220afe62fca6cdc859ec00b72382b7ef14e3cad54cfea8628a5be8?se=2023-04-10T04%3A45%3A00Z&sig=ivtHO6Ot29QU3g6woME4x%2ByKYm5oeILoT7vYDavUGD ######################################################################## 100.0% ==> Installing dependencies for [email protected]: apr, zstd, freetds, openexr and sqlite ==> Installing [email protected] dependency: apr ==> Pouring apr–1.7.3.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/apr/1.7.3: 59 files, 1.4MB ==> Installing [email protected] dependency: zstd ==> Pouring zstd–1.5.5.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/zstd/1.5.5: 31 files, 2.3MB ==> Installing [email protected] dependency: freetds ==> Pouring freetds–1.3.18.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/freetds/1.3.18: 1,262 files, 14MB ==> Installing [email protected] dependency: openexr ==> Pouring openexr–3.1.7.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/openexr/3.1.7: 194 files, 6.0MB ==> Installing [email protected] dependency: sqlite ==> Pouring sqlite–3.41.2.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/sqlite/3.41.2: 11 files, 4.5MB ==> Installing [email protected] ==> Pouring [email protected]–8.0.28.arm64_ventura.bottle.tar.gz ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set php_ini /opt/homebrew/etc/php/8.0/php.ini system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set php_dir /opt/homebrew/share/[email protected] system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set doc_dir /opt/homebrew/share/[email protected]/doc system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set ext_dir /opt/homebrew/lib/php/pecl/20200930 system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set bin_dir /opt/homebrew/opt/[email protected]/bin system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set data_dir /opt/homebrew/share/[email protected]/data system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set cfg_dir /opt/homebrew/share/[email protected]/cfg system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set www_dir /opt/homebrew/share/[email protected]/htdocs system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set man_dir /opt/homebrew/share/man system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set test_dir /opt/homebrew/share/[email protected]/test system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear config-set php_bin /opt/homebrew/opt/[email protected]/bin/php system ==> /opt/homebrew/Cellar/[email protected]/8.0.28/bin/pear update-channels ==> Caveats To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php_module /opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

Finally, check DirectoryIndex includes index.php DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in: /opt/homebrew/etc/php/8.0/

[email protected] is keg-only, which means it was not symlinked into /opt/homebrew, because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH, run: echo ‘export PATH=”/opt/homebrew/opt/[email protected]/bin:$PATH”’ » ~/.zshrc echo ‘export PATH=”/opt/homebrew/opt/[email protected]/sbin:$PATH”’ » ~/.zshrc

For compilers to find [email protected] you may need to set: export LDFLAGS=”-L/opt/homebrew/opt/[email protected]/lib” export CPPFLAGS=”-I/opt/homebrew/opt/[email protected]/include”

To restart [email protected] after an upgrade: brew services restart [email protected] Or, if you don’t want/need a background service you can just run: /opt/homebrew/opt/[email protected]/sbin/php-fpm –nodaemonize ==> Summary 🍺 /opt/homebrew/Cellar/[email protected]/8.0.28: 500 files, 77.8MB ==> Running brew cleanup [email protected]… Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew). ==> Caveats ==> [email protected] To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php_module /opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

Finally, check DirectoryIndex includes index.php DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in: /opt/homebrew/etc/php/8.0/

[email protected] is keg-only, which means it was not symlinked into /opt/homebrew, because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH, run: echo ‘export PATH=”/opt/homebrew/opt/[email protected]/bin:$PATH”’ » ~/.zshrc echo ‘export PATH=”/opt/homebrew/opt/[email protected]/sbin:$PATH”’ » ~/.zshrc

For compilers to find [email protected] you may need to set: export LDFLAGS=”-L/opt/homebrew/opt/[email protected]/lib” export CPPFLAGS=”-I/opt/homebrew/opt/[email protected]/include”

To restart [email protected] after an upgrade: brew services restart [email protected] Or, if you don’t want/need a background service you can just run: /opt/homebrew/opt/[email protected]/sbin/php-fpm –nodaemonize

export PATH=”/Applications/XAMPP/xamppfiles/bin/:$PATH” export PATH=$PATH:/Users/msd/Code/enviroment/flutter/bin #export PATH=$PATH:/Applications/XAMPP/bin export PATH=$PATH:/Applications/XAMPP/xamppfiles/htdocs/composer/composer.phar #export PATH=$PATH:/user/bin/python3 alias python=/usr/bin/python3 export PATH=$PATH:/opt/homebrew/bin #export PATH=”/opt/homebrew/opt/[email protected]/bin:$PATH” #export PATH=”/opt/homebrew/opt/[email protected]/sbin:$PATH” export PATH=”/opt/homebrew/opt/[email protected]/bin:$PATH” export PATH=”/opt/homebrew/opt/[email protected]/sbin:$PATH”


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK