asdf-community / asdf-php

PHP plugin for the asdf version manager
https://github.com/asdf-vm/asdf
Apache License 2.0
223 stars 102 forks source link

[Docs] Clarify usage of `echo` for adding extensions #156

Open TheDevick opened 1 year ago

TheDevick commented 1 year ago

Hey!

I noticed that the current documentation here suggests using the echo {message} > {file} command to add new extensions to PHP. There's a potential risk associated with it. Using the > operator will overwrite the entire file!

I recently lost all the configurations in my php.ini file when trying to add a new extension. While I understand that this was my fault, I believe we can improve the documentation to prevent such accidents in the future.

Proposed Improvement:

I suggest updating the documentation to use the >> operator instead of > Here's the revised command:

pecl install redis
pecl install imagick

echo "extension=redis.so
extension=imagick.so" >> $(asdf where php)/conf.d/php.ini