Php extension ext fileinfo

требует ext-fileinfo. Как добавить это в мой файл composer.json?

введите описание изображения здесь

Вам необходимо установить & включить расширение FileInfo PHP, которое устанавливается по умолчанию, начиная с PHP 5.3.0. Версии до 5.3+ могут использовать прерванное расширение PECL .

Чтобы включить расширение FileInfo, вам нужно отредактировать php.ini и изменить одну строку.

Чтобы узнать, где находится ваш php.ini, вы можете запустить следующую команду с терминала:

и найдите « Загруженный файл конфигурации ».

Обратите внимание : PHP CLI может загружать другой файл php.ini, чем в Интернете, поэтому не полагайтесь на путь, указанный в phpinfo() . Выполните команду, указанную выше в терминале, чтобы узнать файл, загруженный PHP CLI.

Нам не нужно ничего делать в composer.json

Включить расширение fileinfo в php.ini

extension= php_fileinfo.dll 

1) Загрузите и разблокируйте пакет

wget http://pecl.php.net/get/Fileinfo-1.0.4.tgz

tar -zxf Fileinfo-1.0.4.tgz

cd Fileinfo-1.0.4

2) Создайте расширение для компиляции

phpize

./configure

4) сгенерировать установочные файлы и установить их

делать

сделать установку

5) Теперь расширение будет доступно в каталоге / usr / lib64 / php / modules. Теперь вам нужно добавить расширение где-нибудь в файле конфигурации php. Измените /etc/php.ini и добавьте следующее: extension = fileinfo.so 6) Сохраните файл и перезапустите веб-сервер

перезагрузка службы httpd

Чтобы проверить, что модуль fileinfo включен правильно, выполните:

php -i | grep fileinfo

поддержка fileinfo => включена

Просто FYI, модуль также может быть установлен с помощью команды PECL, т.е.

pecl install fileinfo

После этого просто выполните шаги 5 и 6, упомянутые выше, чтобы включить его. Вот и все.

Если кто-то еще находится на DreamHost (например, я) или обнаруживает, что исправления php.ini не делают то, что вы хотите, вы можете попробовать другой маршрут.

Вот страница Wiki DreamHost на PHP.ini , но я также перечислим приведенные ниже шаги.

Шаг 1. Создайте файл конфигурации PHP (phprc)

  1. В домашней папке вашего пользователя ( /home/your_user_name ) создайте новую папку под названием .php (обратите внимание на /home/your_user_name период)
  2. Внутри этой новой папки создайте другую папку на основе используемой вами версии PHP . Вы можете найти это (и изменить его) на панели хостинга (DreamHost находится на панели.dreamhost.com в разделе «Домены»> «Управление доменами»). Поэтому, если вы используете PHP версии 5.6, создайте папку под названием 5.6 .
  3. В этой новой папке создайте новый файл phprc (без расширения). Если в этой папке уже есть файл phprc , вы можете создать резервную копию, изменив имя файла на phprc.old .
Читайте также:  Css table cell right

Шаг 2: отредактируйте phprc чтобы включить расширение

  1. Откройте новый файл phprc .
  2. Добавьте эту строку в конец: extension = fileinfo.so
  3. Сохранить файл

Шаг 3: Перезапустите PHP и / или ваш веб-сервер.

Если у вас есть общий хостинг или вам не нравится SSH или командная строка, вы можете заставить DreamHost забрать ваши новые настройки phprc .

Изменить настройки

  1. Перейдите к панели и перейдите в раздел Домены> Управление доменами.
  2. Нажмите « Edit рядом с доменом, над которым вы работаете.
  3. Не вносите никаких изменений здесь. Просто прокрутите вниз и нажмите в нижней части первой секции.
  4. В течение примерно 10 минут DreamHost потянет ваши изменения.
  5. Если вы не видите обновления через 10 минут (будьте терпеливы!), Обратитесь за помощью в службу поддержки.

Если вам удобно использовать командную строку (и вы не используете общий хостинг), SSH на свой сервер и выполните следующие команды:

sudo /etc/init.d/httpd2 restart 
sudo /etc/init.d/nginx stop pkill -9 php sudo /etc/init.d/nginx start 

Ваши конкретные команды могут немного отличаться, но если вам удобно с CLI, вы, вероятно, знаете свою конкретную команду.

Щелкните левой кнопкой мыши значок в трее -> PHP -> Расширение PHP -> php_fileinfo

Он перезапустит ваш сервер, и все будет готово.

Если это не сработает, попробуйте отредактировать php.ini внутри: C:\wamp\bin\php\php5.4.12 (последняя часть зависит от вашей версии php)

Найдите строку ;extension=php_fileinfo.dll и удалите ;

Сохраните и перезапустите службы WAMP.

  • Youtube PHP APi Check VIdeo дублируется или нет
  • Двойной не (!!) оператор в PHP
  • Можем ли мы установить «allow_url_fopen» «ON» с помощью функции ini_set () в php
  • Android: отправка файла на сервер: PHP получает этот файл на сервере
  • Как добавить несколько значений в один параметр в форме html?
  • Проблемы с отображением японских символов с использованием PHP и MySQL
  • php – один час раньше, чем с датой
  • Как преобразовать SOAP-ответ в PHP-массив?
  • Разница между возвращаемым значением выражения PHP и переменной
  • Пользовательская страница 404 – PHP
  • одиночная цитата внутри двойной цитаты в php
  • Является ли XMLReader синтаксическим анализатором SAX, парсером DOM или нет?
  • PHP Web Application (Magento) взломан; Что делает этот код хакера?
  • Зачем вызывать mb_convert_encoding для дезинфекции текста?
  • Какие инструменты и расширения являются критическими для разработки Magento?

Источник

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

FileInfo position

You need to install & enable FileInfo PHP extension, which is installed by default starting with PHP 5.3.0. Versions prior to 5.3+ may use the discontinued PECL extension.

To enable FileInfo extension, you need to edit your php.ini and change a single line.

To find out where your php.ini is located, you can run the following command from a terminal:

and search for «Loaded Configuration File«.

Please note that the PHP CLI can load a different php.ini file than the web, so don’t rely on the path provided in phpinfo() . Run the command specified above in a terminal to find out the file loaded by PHP CLI.

We dont need to do anything in composer.json

Enable fileinfo extension in php.ini

extension= php_fileinfo.dll 

1) Download and untar the package

Читайте также:  Wordpress css menu classes

wget http://pecl.php.net/get/Fileinfo-1.0.4.tgz

tar -zxf Fileinfo-1.0.4.tgz

cd Fileinfo-1.0.4

2) Generate the extension for compiling

phpize

./configure

4) generate the install files and install it

make

make install

5) Now the extension will be available under the /usr/lib64/php/modules directory. You now need to add the extension somewhere in the php configuration file. Edit /etc/php.ini and add the following: extension=fileinfo.so 6) Save the file and restart the webserver

service httpd restart

To verify fileinfo module is enabled properly, execute:

php -i | grep fileinfo

fileinfo support => enabled

Just an FYI, the module can also be installed using the PECL command i.e.

pecl install fileinfo

Once done, just follow steps 5 and 6 mentioned above to enable it. That’s it.

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

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.

Change 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 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:

sudo /etc/init.d/httpd2 restart 
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.

Источник

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

FileInfo position

You need to install & enable FileInfo PHP extension, which is installed by default starting with PHP 5.3.0. Versions prior to 5.3+ may use the discontinued PECL extension.

To enable FileInfo extension, you need to edit your php.ini and change a single line.

To find out where your php.ini is located, you can run the following command from a terminal:

Читайте также:  METANIT.COM

and search for «Loaded Configuration File«.

Please note that the PHP CLI can load a different php.ini file than the web, so don’t rely on the path provided in phpinfo() . Run the command specified above in a terminal to find out the file loaded by PHP CLI.

We dont need to do anything in composer.json

Enable fileinfo extension in php.ini

extension= php_fileinfo.dll 

1) Download and untar the package

wget http://pecl.php.net/get/Fileinfo-1.0.4.tgz

tar -zxf Fileinfo-1.0.4.tgz

cd Fileinfo-1.0.4

2) Generate the extension for compiling

phpize

./configure

4) generate the install files and install it

make

make install

5) Now the extension will be available under the /usr/lib64/php/modules directory. You now need to add the extension somewhere in the php configuration file. Edit /etc/php.ini and add the following: extension=fileinfo.so 6) Save the file and restart the webserver

service httpd restart

To verify fileinfo module is enabled properly, execute:

php -i | grep fileinfo

fileinfo support => enabled

Just an FYI, the module can also be installed using the PECL command i.e.

pecl install fileinfo

Once done, just follow steps 5 and 6 mentioned above to enable it. That’s it.

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

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.

Change 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 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:

sudo /etc/init.d/httpd2 restart 
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.

Источник

Оцените статью