Openssl php extension linux

nextlevelshit / install-laravel-on-ubuntu.md

In that installation guide i will carry you through all dependencies of Lumen 5.5 on a system with Ubuntu 17.04. I will also provide known issues, that come along the installation of Lumen.

1. Requirements for installing Lumen 5.5

Type in the commands beneath the required package and check if you have yet installed them. If not, click the link for installation guide.

Depending on your preferences you can choose for example MySQL, MariaDB or NoSQL. All of them provide the needed PHP Data Object (PDO).

If any extension cannot be found, install PDO Extension for PHP.

2. Downloading Composer (PHP Package Manager)

Composer is used to manage dependencies. It is very common and will help you develope better software. Get to know which packages are popular on Packagist the PHP Package Repository.

You will download the installer file to your current directory, check the hash, install composer and remove that downloaded file. For detailed information please look on Composer’s download guide.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') < echo 'Installer verified'; >else < echo 'Installer corrupt'; unlink('composer-setup.php'); >echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
composer global require "laravel/lumen-installer"

To have lumen beeing used as command line interface (CLI) you have to put Composer to your PATH file. In most cases Composer is installed in ~/.composer .

Open your ~/.bashrc or ~/.profile and add:

# Composer export COMPOSER_HOME="$HOME/.composer" export PATH="$COMPOSER_HOME/vendor/bin:$PATH"
Lumen Installer 1.0.2 Usage: command [options] [arguments] Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: help Displays help for a command list Lists commands new Create a new Lumen application.

Источник

Linux openssl php extension

Появилась необходимость работы с Эцп (электронной цифровой подписью) в частности с файлами расширения .p12, Нашел немало информации по openSsl , но большинство из этого — cmd команды, что мне не очень подходит.
Искал применение именно с использованием php Нашел тут newblog.kz/posts/view/91 информацию по считыванию ключа Снял запрет на extension=php_openssl.dll в php.ini и скачал данную dll — ку

Подключил .p12 файл как в примере по вышеуказанной ссылке, но у меня не отработала команда openssl_pkey_get_details Ввиду непонимания последующих действий скачал библиотеку с официального сайта www.openssl.org/source Но там не отдельная dll, а огромная библиотека с кучей файлов и папок и я не знаю как её подключить к php.ini (есть ли в этом нужда?!) Для поставленной задачи (считывать и отправлять ЭЦП) рассматриваются php и java, пока по php я почти не увидел примеров реализации. Кто — нибудь сталкивался с реализацией работы с Эцп в php? Источник

Читайте также:  Remote terminal windows linux

Linux openssl php extension

Также библиотека OpenSSL имеет дополнительные требования для нормальной работы во время исполнения. Самое главное, OpenSSL требуется доступ к генераторам случайных и псевдослучайных чисел; на большинстве систем Unix/Linux, это означает доступ к устройствам /dev/urandom или /dev/random . Начиная с PHP 5.6.3, доступна опция конфигурации —with-system-ciphers, которая заставляет PHP использовать системный список шифров вместо жестко заданного по умолчанию.

  • Переменная окружения OPENSSL_CONF . Если установлена, то должна содержать путь (включая имя файла) до конфигурационного файла.
  • переменная окружения SSLEAY_CONF . Если установлена, то должна содержать путь (включая имя файла) до конфигурационного файла.
  • Файл openssl.cnf будет искаться по стандартному пути для сертификатов, заданному при компиляции DLL. Обычно он задан как C:\Program Files\Common Files\SSL\openssl.cnf (x64) или C:\Program Files (x86)\Common Files\SSL\openssl.cnf (x86), или до PHP 7.4.0, как C:\usr\local\ssl\openssl.cnf .

При установке вы должны определить, установить ли файл по стандартному пути или хранить его в другом месте и задать путь к нему через переменные окружения, что полезно при использовании виртуальных хостов. Обратите внимание, что путь по умолчанию можно переопределить в скрипте используя параметр configargs функции, которой требуется этот файл.

Убедитесь, что непривилегированным пользователям не разрешено изменять openssl.cnf .

Список изменений

Версия Описание
7.4.0 Конфигурационный путь OpenSSL был изменен с C:\usr\local\ssl на C:\Program Files\Common Files\SSL или C:\Program Files (x86)\Common Files\SSL , соответственно.

User Contributed Notes 8 notes

Having recently installed Apache2.2 with PHP 5.2.17 on my Windows 7 development machine, I want to pass along my findings about how to set things up to load the correct versions of the OpenSSL DLLs. Many people have posted elsewhere about the «DLL Hell» that results if the a wrong version is loaded.

First, install Apache 2.2 and check its operation, then download the Windows binaries for PHP from http://windows.php.net/download/. Note that according to the sidebar on that page the recommended version of PHP for use with Apache2 is currently 5.2.17, even though it is back level. Plus, this version comes with all the DLLs you need to use OpenSSL — no need to recompile as the old PHP man page suggests.

Having verified the PHP installation, turn on the OpenSSL support by uncommenting the line

in php.ini, which you will find in the PHP directory (I’ll assume you made that c:/PHP). Next check the location of php_openssl.dll, which you should find in c:/PHP/ext. Also in php.ini find the key extension_dir, and change its value to c:/php/ext. Next, put this location on the end of your PATH (there’s no need to reboot).

At this point, when you start Apache it will attempt to load php_openssl.dll, but if your setup is anything like mine you will see an error. I prefer to start Apache manually, and the error appears in a dialog box: «The ordinal 4114 could not be located in the dynamic link library LIBEAY32.dll». (I’m not sure whether you would get this message if you started Apache as a service). The Apache log also contains an error message saying that php_openssl.dll cannot be loaded, though that message doesn’t name libeay32.dll. Welcome to DLL Hell.

Читайте также:  Zipping files in linux command line

Libeay32.dll enters the picture because php_openssl.dll depends on it (and also on ssleay32.dll). What I think happens is that Apache first tries to load php_openssl.dll programmatically from the path specified by the extension_dir key. But then, the loading of the so-called dependent DLLs is left to Windows’ default mechanism. If Windows finds an incompatible version of a dependent DLL, you get the error.

So clearly the fix is to ensure that the correct version of libeay32.dll is loaded. On my machine, at least three other processes have loaded various versions of this same DLL. They include the Mozy backup client, Windows Explorer (because Mozy installs support in Explorer) and the OpenOffice suite. My machine is quite different in this respect from a dedicated server on which one probably wants as few extraneous processes as possible. Presumably on a server one can follow advice that suggests copying the dlls to the system32 directory, for example. But I’m not about to mess with my other programs by making system-wide changes.

So what to do? I didn’t find the available information on how Windows searches for DLLs to be very useful, mainly because I didn’t understand it. But it does say that the first place Windows looks is «The directory from which the application loaded.»

To cut to the chase, after a lot of experimentation I came to a key realization — «the application» is APACHE, not PHP. So I copied libeay32.dll to the Apache2.2/bin directory. Problem solved. No error messages and running phpinfo confirms that OpenSSL is present and enabled.

CentOS 5.10 can’t enable php-openssl extension

I have installed CentOS 5.10 on my server and PHP 5.4.17, but the problem is that I can’t enable php-openssl extension. By the command ‘locate openssl’ looks like the extension exists, so I tried to create the openssl.ini file in ‘/etc/php.d/’ but there nothing happens.

Output by php -r «phpinfo();» | grep -i openssl :

OpenSSL support => disabled (install ext/openssl)

How I can enable that ext? I tried search in google, but found nothing useful. Sorry for my english. Thanks.

1 Answer 1

You enable it by making sure that the relevant files are installed on your server — you will need openSSL and the PHP openSSL extension (on a nearby RHEL 5.1 box, openSSL support is built in — it seems a little strange the Centos 5.10 should be any different).

If, as apparently in your case it is implemented as an external module, then you’ll also need to amend your php.ini to load the extension. The convention with redhat is that optional extensions have their own file in /etc/php.d

Looking at the rpm list for Centos though, they don’t seem to have openssl in a seperate extension. Could you have a non-standard binary?

Читайте также:  Hp m1132 linux scan

Perhaps someone with Centos 5.10 can advise if it’s linked at compile time (in which case you must have a modified binary)?

PHPBrew: cannot install php or install openssl extension

I seem to be running around in circles trying to install a version of php using phpbrew. When trying to install any version of php it returns a fatal error:

openssl extension not found, to download releases file you need openssl.

But when I try install openssl via phpbrew it also throws an error saying:

Error: PHPBREW_PHP environment variable is not defined. This extension command requires you specify a PHP version from your build list.

Any help would be much appreciated.

Commands & Output

phpbrew —debug install php-5.6.18 +default

phpbrew —debug ext install openssl

Platform

OS: Ubuntu 16.04 (Windows Sub-system for linux)

Running PHP: None yet, cannot install.

Installing PHP: Any version of php on phpbrew

You must enable the openssl extension to download files via https

I wanted to install Zend Framework 2. So I downloaded the skeleton application. As mentioned in the ZF2 manual, we have to issue the command

You must enable the openssl extension to download files via https

Then I enabled the ssl_module in my wamp, I checked the php_ini file and I can see the following line

Still I’m getting the same error. Anybody having any clue what I missed out?

13 Answers 13

PHP CLI SAPI is using different php.ini than CGI or Apache module.

Find line ;extension=php_openssl.dll in wamp/bin/php/php#.#.##/php.ini and uncomment it by removing the semicolon ( ; ) from the beginning of the line.

Verify you are editing the correct php.ini file.

«WAMP uses different php.ini files in the CLI and for Apache. when you enable php_openssl through the WAMP UI, you enable it for Apache, not for the CLI. You need to modify C:\wamp\bin\php\php-X.Y.Z\php.ini to enable it for the CLI.»

make sure you have correct path to extension folder

by default it is commented with ; character

I also had the same issue while playing around Zend Framework 2 and composer. I’m using PHP 5.4 (installed via macports) and my solution was to install openssl for PHP 5.4 via macports as well.

I have faced this problem, but configuging openssl (also for cli) did not help.

I have updated composer and this sloved my problem.

I use XAMPP. In C:\xampp\php\php.ini, the entry for openssl did not exist, so I added «extension=php_openssl.dll» on line 989, and composer worked.

You need to enable «extension=php_openssl.dll» in both files (php and apache). my pc files path are these :

Uttam, if your issue is not solved then try the follwoing 3 step approach. It worked for me as I had exactly same issue.

step1: click on wamp tray icon.

step2: goto menu apache->apache modules

step3: click on menu item «ssl_module»

it will automatically restart wamp. if wamp not restarted automatically then restart it through wamp tray menu-> Restart All services. After restart confirm that «ssl_module» coming as ticked under menu apache->apache modules

Источник

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