cmderdev/cmder

does cmder come packaged with curl and php?

gdplay opened this issue · 10 comments

gdplay commented

Question

pretty basic question but does cmder come preinstalled with php and curl?
and if not how can i install it into cmder

Checklist

  • I have read the documentation and made sure what I'm looking for isn't present, or is unclear.
  • I have searched for similar issues, and either this question wasn't asked before, or I didn't find any that describe my question.

If running Cmder - Full.

Curl - yes
Php - no

gdplay commented

If running Cmder - Full.

Curl - yes Php - no

so how do i add php to cmder

@gdplay Note that curl.exe comes with Windows 10 and 11 pre-installed, so that works even with Cmder Mini.

Regarding PHP, first you can take a look at Laragon which comes bundled with PHP and an earlier version of Cmder: https://github.com/leokhoa/laragon

Due to the outdated version, Laragon doesn't satisfy me, so you can install PHP separately if you want.
It's super easy to add, but I have written all the info you might want below.

  1. Download the latest version of php here: https://windows.php.net/download/
    The best one at the time of writing this is VS16 x64 Non Thread Safe, firstly because it's for 64-bit and also because the NTS version is prefered in command-line apps rather than ZTS, which stands for Zend Thead Safe or simply TS (Thread-Safe).
  2. Extract the zip file to somewhere, for example:
    • You want PHP inside Cmder only: [cmder_root]\opt
    • You want PHP system-wide (globally): C:\development\php or C:\tools\php or just C:\PHP
  3. Add the PHP's directory to the path
    • (Optionally) If you have extracted to [cmder_root]\opt, read this Readme.md on how to configure Cmder to use your PHP,
      For example open %cmder_root%\config\user_profile.cmd and add %lib_path% enhance_path "%cmder_root%\opt\php"
      If you go this route, @daxgames can help with using the opt dir.
    • OR, personally I want to be able to use php.exe globally, even outside Cmder, so I added the php root directory to path, you can read our guide here: https://github.com/cmderdev/cmder/wiki/Setting-up-Environment-Variables
      Important: In the guide above, you may skip defining the %cmder_root%, you only need to add the php root dir to '%PATH%'
  4. Now add your php.ini configuration file based on your needs. If you don't have one, there is a file called php.ini-development that I recommend copying and pasting as php.ini because the development one is more suited for desktop computers than the production one.
    If you are curious, here is my own php.ini file that is suited for PHP 8.2: 📄php.ini
    I have applied some useful tweaks, such as disabling the output buffer, increased max_execution_time and memory_limit and post_max_size, enabled startup errors, disabled html-style errors, etc. You shouldn't use it directly since I have enabled extensions that you might not have installed, such as the Xdebug php debugger. Rather compare it with the php.ini-development file that I mentioned to see what values you personally might want to use. Use either VS Code, WinMerge or some other tool to compare files.

After that, you can run php -v to ensure it is installed correctly:

PHP 8.1.13 (cli) (built: Nov 22 2022 15:49:14) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies

If something didn't work or you needed help don't hesitate to ask, if I have time, I'll be happy to help.

Last I checked, Laragon was easily updateable to current Cmder simply by replacing the Cmder folder it includes with a newer version. I did some of the work to make that possible.

@daxgames Good to hear, @gdplay you can test this out to see if our recent changes in Cmder would break anything. If it works, awesome! If not, you'll need to open an issue in the laragon repo.

@daxgames I don't support putting binary blobs in git. Maybe they shoud've used a build system to pull the latest (or a specific) version of Cmder and build in with CI, like we do with the vendored dependencies. It's weird to me to include .exe files in a git repo. We don't do it for Clink and ConEmu.

@DRSDavidSoft I don't know what you are referring to when you say 'binary blobs'.

To clarify, laragon is including the built .exe files in the source codebase repository. For example, it does that with Clink:
https://github.com/leokhoa/laragon/tree/master/bin/cmder/vendor/clink

I'd prefer it if the repo wouldn't contain .exe files, like what the Cmder repo does.

gdplay commented

ok so if i download laragon and run the cmder in it it has php installed with it?

@gdplay True, Laragon is a complete development environment which has PHP and Cmder inside it.

gdplay commented

alright thanks