requires ext-fileinfo. How do I add that into my composer.json file?

后端 未结 4 1498
北海茫月
北海茫月 2020-12-09 09:37

I am trying to install intervention/image. After running the composer update, I get:

\"enter

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 10:07

    If anyone else is on DreamHost (like me) or finds that the php.ini edits don't do what you want, you can try another route.

    Here's the DreamHost Wiki page on PHP.ini, but I'll list the steps below as well.

    Step 1: Create a PHP configuration file (phprc)

    1. In your user's home folder (/home/your_user_name), create a new folder called .php (notice the leading period)
    2. Inside this new folder, create another folder based on the version of PHP that you're using. You can find this (and change it) on the hosting panel (DreamHost's is at panel.dreamhost.com under Domains > Manage Domains). So if you're using PHP version 5.6, create a folder called 5.6.
    3. Inside this new folder, create a new file called phprc (no extension). If there's already a phprc file in this folder, you can back it up by changing the filename to phprc.old.

    Step 2: Edit phprc to include the extension

    1. Open your new phprc file.
    2. Add this line to the end: extension = fileinfo.so
    3. Save the file

    Step 3: Restart PHP and/or your web server

    Via Panel

    If you have shared hosting, or you aren't comfortable with SSH or the command line, you can force DreamHost to pick up your new phprc settings.

    1. Navigate back to your Panel, and go to Domains > Manage Domains.
    2. Click Edit next to the domain you're working on.
    3. Don't make any changes here. Simply scroll down and click Change Settings at the bottom of the first section.
    4. Within about 10 minutes, DreamHost will pull in your changes.
    5. If you don't see updates after 10 minutes (be patient!), contact support for help.
    Via SSH

    If you're comfortable with the command line (and you're not using shared hosting), SSH into your server and run the following commands:

    For Apache web servers
    sudo /etc/init.d/httpd2 restart
    
    For Nginx web servers
    sudo /etc/init.d/nginx stop
    pkill -9 php
    sudo /etc/init.d/nginx start
    

    Your specific commands may be slightly different, but if you're comfortable with CLI then you probably know your specific command.

提交回复
热议问题