Skip to content

Instantly share code, notes, and snippets.

@abenevaut
Last active August 23, 2024 10:00
Show Gist options
  • Save abenevaut/149adce59c6dd68da3eda8699888e624 to your computer and use it in GitHub Desktop.
Save abenevaut/149adce59c6dd68da3eda8699888e624 to your computer and use it in GitHub Desktop.

Capture_2024-06-16_à_14_44_55
  • Unzip to C:\php-8.3.8-nts-Win32-vs16-x64 (or where you want. Care if you choose a path with space, some troubles could came with);
  • copy the file C:\php-8.3.8-nts-Win32-vs16-x64\php.ini-development to C:\php-8.3.8-nts-Win32-vs16-x64\php.ini
  • then uncomment following lines, by removing ";" on line start:
extension=openssl
extension=zip
extension_dir = "ext"
  • Optionnal: if you plan to use Laravel, uncomment also:
extension=fileinfo
extension=pdo_sqlite
  • add php path to env vars

  • validate in terminal you are able to run php -v successfully

Composer download page

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

Replace <REPLACE-ME> with the current hash

php -r "if (hash_file('sha384', 'composer-setup.php') === '<REPLACE-ME>') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

Finally

php composer-setup.php
php -r "unlink('composer-setup.php');"

We add an execution file for Windows command line terminals cd C:\php-8.3.8-nts-Win32-vs16-x64\composer.bat

@echo OFF
:: in case DelayedExpansion is on and a path contains ! 
setlocal DISABLEDELAYEDEXPANSION
php "%~dp0composer.phar" %*

Automated alternative :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment