php-7.2

MCrypt rijndael-256 to OpenSSL aes-256-ecb conversion

北战南征 提交于 2019-12-30 09:32:30
问题 Since Mcrypt is deprecated, I want to use OpenSSL instead in my code since we already using php 7.2.4 in our server. I have used following code for Encryption/Decryption. //ENCRYPTION function encrypt($text, $salt='') { if ($text == "") return ""; if ($salt == "") $salt = 'DiAo74dOO09T48YESmuvbS0T'; return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv (mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))); } /

In localhost it's still showing the lowest version using Ubuntu

删除回忆录丶 提交于 2019-12-25 02:28:06
问题 I have updated my PHP version to 7.2 in my Ubuntu machine. I am getting this version while running this php -v command in my terminal and getting the below output. PHP 7.2.1-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 11 2018 22:52:58) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.2.1-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies But when I am running localhost file

What does strict types do in PHP?

眉间皱痕 提交于 2019-12-25 01:28:14
问题 I've seen this new line in PHP7 but nobody really explains what it means. I've googled it and all they talk about is will you be enabling it or not like a poll type of thing. declare(strict_types = 1); What does it do? How does it affect my code? Should I do it? Some explanation would be nice. 回答1: From Treehouse blog : With PHP 7 we now have added Scalar types. Specifically: int, float, string, and bool. By adding scalar type hints and enabling strict requirements, it is hoped that more

understand pm.max_children tuning

孤街浪徒 提交于 2019-12-24 19:57:23
问题 I have done some investigations and I have found this to calculate and adjust pm.max_children value https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/ but for example : I have 8Gb on my server I'm hosting 30 websites php-fpm average process size around 40mb php-fpm max process size around 80mb I want to allocate 5Gb max of my memory to php-fpm processes If I apply this : pm.max_children = Total RAM dedicated to the web server / Max child process size So in my case

install php-gd ext on Debian

邮差的信 提交于 2019-12-24 08:12:13
问题 I'm not able to install php-gd extension on my server. I have php 7.2: PHP 7.2.10-1+0~20181001133426.7+jessie~1.gbpb6e829 (cli) (built: Oct 1 2018 13:50:53) ( NTS ) and debian 8 linux: Debian GNU/Linux 8 command to install GD extension: sudo apt-get install php7.2-gd and result: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libc-ares2 libnfsidmap2 libpcre16-3 libpcre32-3

PHP72 MongoDB driver with Homebrew on OSX

老子叫甜甜 提交于 2019-12-23 02:39:26
问题 I have a question that might point to a misunderstanding I have with Homebrew in relation to MongoDB: I am running XAMPP (version) with PHP 7.2.1 (which I want to use) on Mac OSX 10.12.6 (Sierra). I installed MongoDB and created configuration and data storage folder. It runs fine on command line (when using mongod and mongodb by terminal). Now, I want to install the PHP driver for PHP 7.2.1. I followed the instructions on http://php.net/manual/en/mongodb.installation.homebrew.php and adapted

Problems with pthreads in PHP

只愿长相守 提交于 2019-12-23 01:21:26
问题 I have a problem with pthreads in PHP. When I start apache I see error like this: php.exe - Entry point not found The procedure entry point was not found _zend_hash_update@@12 in library D:\xampp\php\ext\php_pthreads.dll When I execute script in CMD I have a warning: PHP Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: D:\xampp\php\ext\php_pthreads.dll I copied pthreadVC2.dll to: C:/windows/system32 D:/xampp/php D:/xampp/apache/bin And I copied last file php

How to fix create_function when swapping to PHP 7.2 [duplicate]

梦想与她 提交于 2019-12-13 22:48:37
问题 This question already has answers here : PHP 7.2 Function create_function() is deprecated (4 answers) Closed 11 months ago . I saw people helping on rewriting to anonymous function. But I really don't know how: Deprecated: Function create_function() is deprecated in /mnt/web110/c3/68/51799968/htdocs/portfolio2017/wp-content/themes/clean-photo-wp-modified/internal/includes.php on line 149 Method: /** * Safe file inclusion * * @param $path */ public static function include_isolated( $path ) {

Replace Symfony service in tests for php 7.2

六月ゝ 毕业季﹏ 提交于 2019-12-13 14:07:42
问题 I'm trying to upgrade my application working on Symfony 3.3 and php 7.1 to php 7.2, but I encountered tons of DEPRECATED messages when I run phpunit. Most annoying is: The "user.user_service" service is already initialized, replacing it is deprecated since Symfony 3.3 and will fail in 4.0: 7x This is because I have this lines at setUp method: $this->userService = $this->getMockBuilder(UserService::class) ->setMethods(['update']) ->getMock(); $container->set('user.user_service', $this-

PHP-FPM configuration pm = ondemand or dynamic? [closed]

蓝咒 提交于 2019-12-13 10:44:43
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I would like to have your opinion about PHP-FPM configuration and PM variable. static, ondemand or dynamic? Thanks L. 回答1: problem solved and issue explained here : https://serverfault.com/questions/939436/understand-correctly-pm-max-children-tuning 来源: https://stackoverflow