Меню Рубрики

Linux installing php extensions

Installing PHP extensions on Linux

Please bear with me; I’m a developer, not a server admin. My company wants to explore using Magento. They’ve handed me a pre-configured Linux server with apache and PHP installed, but when I try to run the Magento setup, it tells me that there are PHP extensions that need to be loaded. I can edit the php.ini file, but have no idea where to get the extensions or how to install them, and there’s no one here who knows, either.

Can anyone give me a hand? I need the PDO_MySQL, mcrypt, and GD extensions. I’ve searched and found sites that talk about downloading from the terminal and compiling code, but it’s all way over my head. Is there an easy way to do this?

4 Answers 4

Often Linux system have the pear application in repository, so you would just need to run a command for each extension you’d like to install.

It might help to know what distro you are running, and what version of php. I’m talking about the process of finding packages as well since its better to know how to find stuff than just install what you’re told. Teach an man to fish and all that.

Now, I have ubuntu and centos boxen on hand, and through the magic of the package search command.

For Ubuntu

I used apt-cache search KEYWORD php to find the packages in question — in this case the name of the plugin as the keywords. From that, you can install the 3 packages you need through apt-get install php5-mcrypt php5-gd php5-mysql — the last package should cover PDO on debian like distros I believe

For Centos/Red Hat

I used dnf search KEYWORDS the same way — but not all the packages you need seem available by default. Older versions of these distributions use yum rather than dnf.

The packages you’re interested in are php-pdo php-gd and php-mcrypt — the last is not in the default repository (I checked on yum, then googled)- you may need to add the EPEL repository to get that package instead

Using the default package manager should result in easier to install and maintain packages, since your updates will happen with everything else.

Источник

Установка PHP-расширений в Ubuntu для полноценной работы WordPress и плагинов

В большинстве статей по самостоятельной настройке веб-сервера опущен один очень важный момент — установка расширений для PHP, без которых тот же WordPress нормально работать не будет. Применительно к Вордпрессу список необходимых расширений PHP сильно зависит от того какие плагины Вы будете использовать, ниже будет приведен не полный список, но покрывающий 99% потребностей WordPress и достаточный для большинства случаев. Я установил на VPS Ubuntu 16.04 далее примеры команд для этой версии Линукс.

Устанавливать расширения удобнее всего из консоли (терминала), для установки минимально необходимого набора выполните команду:

sudo apt-get install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc php-mcrypt php-curl php-gd

Обратите внимание что эта команда установить расширения для текущей версии PHP, на данный момент это 7.0, если например Вы используете пятую версию PHP, то нужно использовать другую команду:

sudo apt-get install php5-curl php5-gd php5-mbstring php5-mcrypt php5-xml php5-xmlrpc php5-mcrypt php5-curl php5-gd

Просмотреть установленные расширения можно командой:

sudo dpkg —list | grep php
После установки расширений может потребоваться перезапуск веб-сервера apache:

sudo /etc/init.d/apache2 restart

Список расширений PHP которые может использовать WordPress и его плагины:

php-mysql — нужно для работы с базами данных, как правило устанавливается автоматически вместе с PHP.
php-ctype — необходимо установить если получаете ошибку Fatal error: Call to undefined function ctype_digit() in /wp-admin/includes/file.php
php-dom — не обязательное, может понадобиться если у Вас Windows-хостинг
php-exif — для работы с мета-данными фотографий
php-gd — для обработки изображений
php-iconv — конвертация строки из одной кодировки в другую
php-json — для поддержки JSON
php-posix — используется в классе WP_Filesystem_Direct
php-mbstring — для обработки строк, для работы обязательно
php-simplexml — не обязательное
php-zip, php-zlib — для работы с архивами, если необходимо

Если Вы используете виртуальный хостинг и у Вас нет возможности самостоятельно управлять сервером и устанавливать необходимые программы и расширения, зайдите в панель управления хостингом, большинство из них предоставляют возможность активировать нужные для работы расширения PHP, например вот так выглядят настройки в Cpanel:

Здесь можно выбрать нужную версию PHP и изменить список активных расширений, на картинке указан набор галочек при котором работают практически все плагины WordPress, у меня их установлено несколько десятков на все случаи жизни и все они нормально работают.

Источник

Обновляем расширение Intl в PHP 7 на Linux Ubuntu 16.04

Программисты делятся на два типа: консерваторы, для которых переход на новую версию равносилен перелёту на другую планету (если читаешь это из Windows XP — поздравляю, это ты); и Викторы Цои, чьи сердца и глаза требуют перемен, и обновляют всё и вся при первой возможности. Если ты второго типа, и у тебя уже стоит последняя версия PHP на последней LTS версии Ubuntu, но покоя не даёт то, что расширение Intl использует устаревшую версию библиотеки ICU, или тебе просто понравились картинки из «Аватара» — добро пожаловать под кат! (Картинок больше не будет.)

Ну и зачем это?

Библиотека ICU с каждым релизом добавляет поддержку стандартов транслитерации для различных языков, добавляет новые функции и возможности, фиксит баги. Пока неизвестно, по какой причине PHP нерегулярно обновляет ICU в расширении Intl. Поэтому приходится всё брать в свои руки.

Поиск решения

Быстрый поиск по гуглу не дал внятных решений. Детальный тоже. В общем и целом пэхэпэшным программистам по барабану, какую версию ICU использует Intl. Но только не нашим! Отчаявшись искать в англоязычном сегменте интернета, совершенно случайно набрёл на запись русского блогера Сергея Стоянова, где он объясняет процесс обновления ICU в PHP 5 для Ubuntu 14.04. В PHP 7 процесс сильно отличается, но общая последовательность действий остаётся такой же: удаляем Intl; собираем новую версию ICU; устанавливаем Intl, ткнув его носом, где искать ICU; включаем Intl в PHP; открываем шампанское. Также сильно помогли комментарии к статье (особенно комментарий Антона Минина и его shell скрипт).

Версии ICU

Проверить последнюю версию ICU можно на их официальном сайте. На данный момент (февраль 2018) последний релиз — 60.2.

Чтобы проверить, какую версию ICU использует php7.0-intl, напиши в терминале и прокрути до списка установленных модулей. Найди там раздел, озаглавленный «intl». У меня там было:

Internationalization support => enabled
version => 1.1.0
ICU version => 55.1
ICU Data version => 55.1

Мягко говоря, не айс — версия 55.1 была выпущена в первой половине 2015-го, и с тех пор успела обновиться ещё 5 раз. Нужно же что-то делать!

Решение

Internationalization support => enabled
version => 1.1.0
ICU version => 60.2
ICU Data version => 60.2

Источник

Install php extensions in ubuntu 16.04

I need install the following extension with php5.6 and ubuntu 16.04, but ubuntu only install extensions for php 7 this extension i cannot install with the issue related Installing PHP 5.6 on Xenial (16.04)

I need to use the functions:

and the gd library. any answer that can help me, thanks

2 Answers 2

Ok finding in a lot of blogs and aswer, the obviously answer is add suffix in php, then for install php5.6 or before add this.

later of this you need install extension with the following commands

if you install php 5.6 you need add 5.6 to php, for example

etc . or otherwise if you make php-gd you install gd for php7, and thanks to @elder-geek for add links

It’s entirely possible that I am misunderstanding you entirely but if what you are looking for is available for Xenial (16.04) in the PPA you reference, it can be found listed here.

To enable GD-support configure PHP —with-gd[=DIR] , where DIR is the GD base install directory. To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option —with-gd . GD library requires libpng and libjpeg to compile.

There’s an alphabetical list of extensions on this page

There’s also a list of deprecated and experimental extension to be found here.

You can also obtain the Current Stable PHP 5.6.23 via download

Источник

How to List Compiled and Installed PHP Modules in Linux

If you have installed a number of PHP extensions or modules on your Linux system and you trying to find out a particular PHP module has been installed or not, or you simply want to get a complete list of installed PHP extensions on your Linux system.

In this article, we will show you how to list all installed or compiled PHP modules from Linux command line.

How to List Compiled PHP Modules

The general command is php -m , which will show you a list of all “compiled” PHP modules.

You can search for a specific PHP module for instance php-ftp , using the grep command. Simply pipe the output from the above command to grep as shown (grep -i flag means ignore case distinctions, thus typing FTP instead of ftp should work).

How to List Installed PHP Modules

To list all PHP modules that you have installed via a package manager, use the appropriate command below, for your distribution.

In case you want to find one particular module, like before, use a pipe and the grep command as shown.

To view all php command line options, run.

You might also like to check out these following useful articles about PHP.

That’s all! In this article, we’ve explained how to list installed (or compiled in) modules in PHP. Use the comment form below to ask any questions.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Mac os посмотреть оборудование
  • Mac os посмотреть запущенные процессы
  • Mac os порядок выхода
  • Mac os полосы на экране
  • Mac os полный сброс