php-5.6

BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::belongToMany()'

ぐ巨炮叔叔 提交于 2020-01-07 04:30:48
问题 Following the instructions in this laracast : https://laracasts.com/series/laravel-5-fundamentals/episodes/21 I created a Channel model class Channel extends Model { // protected $fillable = [ 'title', 'description', 'published_at', ]; public function scopePublished($query) { $query->where('published_at', '<=', Carbon::now()); } public function setPublishedAtAttribute($date) { $this->attributes['published_at'] = Carbon::createFromFormat('Y-m-d', $date); } /* * Get the tags associated with the

Error with PHP 5.6 to PHP 7.2.4. Include_once don´t work

こ雲淡風輕ζ 提交于 2020-01-05 13:53:55
问题 The video illustrating the problem in real time is available here: link: https://www.youtube.com/watch?v=IaTJNS31w6A&feature=youtu.be I have been learning web-development. Newbie in PHP. I created a site in a local server WAMP. By default WAMP uses PHP 5.6. When the version is changed to 7.2.4, the site doesn't work. The warnings are: Warning: include_once(/app/config.inc.php): failed to open stream: No such file or directory in E:\wamp64\www\ziurfreelance2\index.php on line 3 and Warning:

PharData extractTo method failed to extract .tar.gz on linux environment

邮差的信 提交于 2020-01-04 04:11:09
问题 I would like to extract .tar.gz file into the particular folder. I have used cURL to download the .tar.gz file from MailChimp batch operation. I have used below code to extract tar file. $phar = new \PharData('upload/test.tar.gz'); $phar->extractTo('upload/',null, true); It is working on windows environment. But on Linux(Ubuntu), I got below error when to run above code. Uncaught exception 'PharException' with message 'Extraction from phar "upload/test.tar" failed: Cannot extract ".",

PHP - get multiple columns from array

微笑、不失礼 提交于 2019-12-30 09:37:43
问题 I have this array: 0 => array:3 [ "product_id" => "1138" "product_image" => "/resources/medias/shop/products/shop-6500720--1.png" "product_sku" => "6500722" ] 1 => array:3 [ "product_id" => "1144" "product_image" => "/resources/medias/shop/products/shop-6501041--1.png" "product_sku" => "6501046" ] 2 => array:3 [ "product_id" => "113" "product_image" => "/resources/medias/shop/products/shop-6294909--1.png" "product_sku" => "6294915" ] What I am looking for is a way to get a multiple array with

Does php 5.6 support prepared statement?

谁说胖子不能爱 提交于 2019-12-26 08:56:08
问题 Does php 5.6 support prepared statement ? As I'm getting this error : "PHP Fatal error: Call to a member function prepare() on resource " Here Is the code : $testSql = $ce_conn -> prepare('select transaction_id from tbl_sales_revenue limit 1'); $testSql -> execute(); $testSql -> bind_result($transaction_id); $testSql -> fetch(); $testSql -> close(); function connectCE() { global $config; $ce_conn = mysql_connect($config['Datasources']['CE']['host'], $config['Datasources']['CE']['username'],

php 5.x 7.x, ssl pdo error: Peer certificate CN=`someName' did not match expected CN='someIP'

做~自己de王妃 提交于 2019-12-23 03:32:14
问题 We have a server with mysql on port 3306. We have sertifications and key and we try to connect to this server. But we see such problem: Peer certificate CN='SomeName' did not match expected CN='someIP' I've read a lot of articles and can't find answer for PDO PHP. The most interesting is that the SQLYog could connect with all settings. I've read that I verify_peer_names can be disabled (I hope I understand what is peer_names...), but only if we use openssl_{functions} or mysqli, not PDO. Both

php5.6 cannot fetch a session variable and THEN delete the variable

旧时模样 提交于 2019-12-23 03:28:27
问题 Today I have a bit of an odd one. I have found out that apparently I cannot use a session variable AND THEN destroy it (without destroying the entire session.) Let me explain. If I do this, for example: if (isset($_SESSION['var'])) { $var = $_SESSION['var']; unset($_SESSION['var']); } var_dump($_SESSION); echo "var: $var"; The result is "var" is empty both as $var and as a key is $_SESSION. However, if you comment out the unsetting part, the var is in both $var as well as in the $_SESSION

Oracle + Oci8 + php5.6 + Ubuntu 16.04

只谈情不闲聊 提交于 2019-12-23 02:34:23
问题 I have Ubuntu 16.04 installed, with PHP5.6 . I download and unzipped Oracle 12.1.0.1.0 , and put it on folder /opt/oracle/instantclient. Export ORACLE_HOME=/opt/oracle/instantclient , making soft links: $ sudo ln -s libocci.so.12.1 libocci.so $ sudo ln -s libclntsh.so.12.1 libclntsh.so After that I add to my system: $echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient After that create a new folder in /opt/oracle/instantclient/src and put in a oci8-2.0.10.tgz version, and

How to get __debugInfo to work with XDebug?

时光怂恿深爱的人放手 提交于 2019-12-22 07:04:01
问题 It seems __debugInfo does not work when xdebug overwrites var_dump . Is there anyway to make this work? I am using PHP 5.6.0 and XDebug 2.2.5 回答1: This is now fixed in Xdebug - soon to be released: https://github.com/xdebug/xdebug/commit/14159486d8d77732b5ae193ca9431bae80c94074 来源: https://stackoverflow.com/questions/26835450/how-to-get-debuginfo-to-work-with-xdebug

mcrypt_encrypt not working properly on PHP 5.6.9

拥有回忆 提交于 2019-12-22 06:58:31
问题 I have the following code which worked fine on PHP 5.5.9. function index() { echo $this->encryptText_3des('TEST','JHHKJH9879'); } function encryptText_3des($plainText, $key) { $key = hash("md5", $key, TRUE); for ($x=0;$x<8;$x++) { $key = $key.substr($key, $x, 1); } $padded = $this->pkcs5_pad($plainText, mcrypt_get_block_size(MCRYPT_3DES, MCRYPT_MODE_CBC)); $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_3DES, $key, $padded, MCRYPT_MODE_CBC)); return $encrypted; } function pkcs5_pad ($text,