php-7

error in zend session database for php7

我与影子孤独终老i 提交于 2019-12-19 04:14:34
问题 My application need to use database instead of file for the session management . My Application is based on Zend Framework 1.12.17, php 5.6.25 and actualy on wampserver That is my config.ini resources.session.use_only_cookies = true resources.session.gc_maxlifetime = 864000 resources.session.remember_me_seconds = 864000 resources.session.gc_probability = 1 resources.session.gc_divisor = 100 resources.session.saveHandler.class = "Zend_Session_SaveHandler_DbTable" resources.session.saveHandler

Does PHP7's PDO ext read the entire result set into memory?

∥☆過路亽.° 提交于 2019-12-18 14:50:52
问题 I have noticed since I upgraded to PHP7 that some SQL statements no longer work and instead run out of memory. I have this code: $query = Yii::$app->db->createCommand('select * from tbl_title')->query(); while ($row = $reader->read()) { var_dump($row); exit(); } And Yii2's database abstraction is just an extremely thin layer over PDO's and does not do anything extra. query() does nothing extra except add a line to a log file (Yii2's) for profiling and reader->read() just calls the PDO stream

Named Parameters solution in PHP 7+

蹲街弑〆低调 提交于 2019-12-18 08:57:44
问题 How can I implement the named argument feature in PHP 7+? The ideal syntax is: find($wildcard, relative = true, listIfEmpty = false) { ... } But there is no solution to do like that. In the answer, I implemented the shortest possible solution that supports: Refactoring Type Hints for the params and function result Reusable param set Typesafe params Default values for params Getter for each param ( no hard-coded string ) Very simple setter/getter that you need to change just one name for every

Error loading oci8.so with Ubuntu server 17.04 php 7 and apache2

陌路散爱 提交于 2019-12-18 07:12:52
问题 I have gone through the whole process of downloading Oracle instant client, SDK, etc. in a Ubuntu Server 17.04. Then converted rpm packages to deb with alien, installed, set the paths, downloaded pecl oci8, compiled and installed (w/o errors), etc. and then added the line: extension=/usr/lib/php/20151012/oci8.so And restarted. When I check the /var/log/apache2/error.log I see: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/oci8.so' - libmql1.so: cannot open

PHP PREG_JIT_STACKLIMIT_ERROR - inefficient regex

寵の児 提交于 2019-12-18 06:59:49
问题 I am getting PREG_JIT_STACKLIMIT_ERROR error in preg_replace_callback() function when working with a bit longer string. Above 2000 characters it is not woking (above 2000 characters that match regex, not 2000 character string). I've read already that it's caused by inefficient regex, but I can't make my regex simpler. Here's my regex: /\{@([a-z0-9_]+)-((%?[a-z0-9_]+(:[a-z0-9_]+)*)+)\|(((?R)|.)*)@\}/Us It should match strings like these: 1) {@if-statement|echo this|echo otherwise@} 2) {@if

Installing mailparse php7 mbstring error

拟墨画扇 提交于 2019-12-18 05:57:09
问题 I'm currently working to put our project under php7. When trying to compile the mailparse extension or use pecl to install it, I get this error: #error The mailparse extension requires the mbstring extension! I did install the php7.0-mbstring and tried to put the mbstring extension with the mailparse source code. I also tried to use my old C skills and try include the libraries myself without success. Any of you has an idea how I could solve my problem? (without editing the code like I saw in

Installing mailparse php7 mbstring error

浪尽此生 提交于 2019-12-18 05:57:00
问题 I'm currently working to put our project under php7. When trying to compile the mailparse extension or use pecl to install it, I get this error: #error The mailparse extension requires the mbstring extension! I did install the php7.0-mbstring and tried to put the mbstring extension with the mailparse source code. I also tried to use my old C skills and try include the libraries myself without success. Any of you has an idea how I could solve my problem? (without editing the code like I saw in

Are scalar and strict types in PHP7 a performance enhancing feature?

好久不见. 提交于 2019-12-18 04:32:00
问题 Since PHP7 we can now use scalar typehint and ask for strict types on a per-file basis. Are there any performance benefits from using these features? If yes, how? Around the interwebs I've only found conceptual benefits, such as: more precise errors avoiding issues with unwanted type coercion more semantic code, avoiding misunderstandings when using other's code better IDE evaluation of code 回答1: Today, the use of scalar and strict types in PHP7 does not enhance performance. PHP7 does not

RegEx not working for long pattern PCRE's JIT compiler stack limit - PHP7

微笑、不失礼 提交于 2019-12-17 20:53:39
问题 I am using oyejorge's less compiler. list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); traps an Exception. I narrowed it down, and I created a test script $regex = '/\\G"((?:[^"\\\\\r\n]|\\\\.|\\\\\r\n|\\\\[\n\r\f])*)"|\'((?:[^\'\\\\\r\n]|\\\\.|\\\\\r\n|\\\\[\n\r\f])*)\'/'; $image = '"data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc

PHP7 + Symfony 2.8, Failed to write session data

老子叫甜甜 提交于 2019-12-17 18:49:00
问题 i compiled php7 on my own (974f6c2a705). if i run php7 + php-fpm + nginx using symfony i get this error: (using the snc redis bundle for sessions:) Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/tmp) (using the native session support:) Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/[...]/app/cache/dev