Deprecated error in pass by reference in latest version of localhost - php

All the project is error free on localhost vertrigo_222 (and also on livehost).
Now I am trying to upgrade my localhost to latest version vertrigo_230.
I am facing following deprecated error:
Here is line number 1170 and 1171:
calculate_city_row_col($row['attacker_city_id'], &$att_city_row, &$att_city_col);
calculate_city_row_col($row['defender_city_id'], &$def_city_row, &$def_city_col);
Please give me some solution.
Thank you in advance.

I think you can try remove & before $att_city_row and $att_city_col, $def_city_row, $def_city_col

Related

Codeigniter 3.1.7 valid_email issue

I have two sites using Codeigniter. Today I have updated sites to Codeigniter 3.1.7 (from 3.1.6). After that at one of this sites email validation had broken, valid_email validation rule doesn't work any more. On second site all fine. I had check out error logs and found error:
ERROR - 2018-02-06 10:13:21 --> Severity: Warning --> idn_to_ascii() expects parameter 3 to be long, string given /public_html/system/libraries/Form_validation.php 1235
Codeigniter's changlog says:
Updated Form Validation Library rule valid_email to use INTL_IDNA_VARIANT_UTS46 for non-ASCII domain names.
It seems to me that INTL_IDNA_VARIANT_UTS46 constant is not defined. Site using PHP Version 5.6.30
How can I fix this issue?
I found discussion of this problem here.
Issue is outdated ICU library (ICU version 4.2.1 was installed)
Go to system/library/email.php and replace valid_email()
public function valid_email($email)
{
if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46') && $atpos = strpos($email, '#'))
{
$email = self::substr($email, 0, ++$atpos).idn_to_ascii(self::substr($email, $atpos), 0, INTL_IDNA_VARIANT_UTS46);
}
return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
}
just get the latest library for email
Get the latest codeigniter zip file
then go to system->libraries->Email file
copy that email file and paste it into your previous Email.php library file then it will work
I think there's a better way to sort out that issue.
As we all know that email library not supported in php 7.2 and that's why error occured
idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated
Error Screenshot of codeigniter email library
Quick Solution :
--> Go to cPanel
--> Select PHP version
--> change it to 7.1 instead of 7.2
For my case. I am also facing this issue.
Error:
Severity: 8192
Message: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated Filename: libraries/Form_validation.php
Line Number: 1234
I downloaded the Latest CodeIgniter version. Then from the system/libraries folder copied Email.php and Form_validation.php. Then replaced with Existing Email.php and Form_validation.php at the same path.
After replace, It is start working Fine..!!
Thanks #Evgeny for Guide.
The above issue would occur when you have incompatible CI and PHP version combinations. I mean newer PHP version and older CI version, vice-versa. I had PHP 7.3 on my machine and the CI repo/project I downloaded from github had CI version 3.1.5. I had to replace the system folder (of 3.1.5 with that of newer CI versions, 3.1.10 in my case) to resolve this issue

Class 'Spatie\Analytics\AnalyticsServiceProvider' not found

This is duplicate question, I am trying to use spatie/laravel-analytics but in localhost it does not throw this error but on server it shows this error, I'm using shared hosting. Also I've tried other solutions. My versions are:
Laravel 5.4
Analytics 3
PHP 7.1.5
Error :
Class 'Spatie\Analytics\AnalyticsServiceProvider' not found
I've deleted and re-uploaded all files, it does not show this error now!

Fatal error: Class 'PHPExcel_Shared_String' not found

I have used PHPExcel for my codeigniter app and it is working perfectly in localhost, but when I host this to server, I am getting following error :
Fatal error: Class 'PHPExcel_Shared_String' not found in \xx\xx\xx
third_party\PHPExcel\Autoloader.php on line 36
There was a change introduced to the autoloader in the latest version of PHPExcel that appears to have broken backward compatibility with versions of PHP < 5.3.0
If you edit the Classes/PHPExcel/Autoloader.php file and change line 58, which should read
return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'), true, true);
to
return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));
I've already made a change to the develop branch on github to test for the PHP version and execute the appropriate line
While this was not deliberate, please note that we really are trying to get users to upgrade to at least version 5.3.0 of PHP, because we can't address any of the memory/performance issues that users working with large spreadsheets complain about until we can use some of the new features available in more recent versions of PHP. Version 5.2 of PHP is no longer supported, and even version 5.3 is end-of-life and will be unsupported before the end of this year
struggled with this issue for a long time under Linux and PHP 5.4x. In the end, in addition to the fix above, I resorted to changing the code on line 73 of the Autoloader file which sets the $pClassFilePath variable from relative (using PHPEXCEL_ROOT) to absolute following the machines file tree. This might only be a hack, but it saved my sanity after several days of trying. Hope this helps someone. Cheers
I had this issue too and i solved it by changing permissions on "Shared" directory to 655.
I Hope it helps
If your server is on Linux, it can be permission problem... Just add all permissions for PHPExcel Folder in you Vendor (on server side) and all subfolders for it. I have same problem and i have solved it by this way...
What worked for me was changing PHPExcel/Autoloader.php line 81 from
if ((file_exists($pClassFilePath) === FALSE) || (is_readable($pClassFilePath) === FALSE)) {
to
if ((stream_resolve_include_path($pClassFilePath) === FALSE)) {
I prefer this approach because it didn't require me to modify file permissions and it should work in PHP 5.3.2 and later.

How To Joomla Install in WAMP SERVER 2.2?

Hello
I am using joomla insttalation in WAMP Server 2.2 installation all are the complate, after that i RUN joomla this type of error occur in home page how to remove that.....plz help me
NOTICE:Array to string conversion in C:\wamp\www\joomlawebsite\components\com_banners\models\banners.php on line 44
Array to string conversion in C:\wamp\www\joomlawebsite\components\com_banners\models\banners.php on line 45
If you are using a 5.4 version of PHP, try downgrading to 5.3 (that should fix the issue as per this Joomla thread.)

Configuring MongoDB + doctrine in Symfony

I was trying to install MongoDB doctrine bundle as written in here
But when I ran the command
$ php bin/vendors install
It throws up the following error:
Fatal error: Call to undefined method
Doctrine\ODM\MongoDB\Configuration::setLoggerCallable()in
C:\wamp\www\Symfony\app\cache\dev\appDevDebugProjectContainer.php on line 245
I have followed the installation instructions to the word (which has not been much anyways...) and i have also double checked my installation... Is there something I am missing here?
Update : A similar problem is mentioned here, but even after following the answer there, i could not successfully configure DoctrineMongoDBBundle.
The latest changes in the Doctrine MongoDB repo have introduces this problem. To stick to a version before this happened, add this line to deps.lock:
doctrine-mongodb 5ccb18231218ce92c9d72295f69bebfe172ef5fb
Well, finally I managed to solve it by adding this to the deps file:
[DoctrineMongoDBBundle]
git=http://github.com/symfony/DoctrineMongoDBBundle.git
target=/bundles/Symfony/Bundle/DoctrineMongoDBBundle
version=origin/2.0
** note the
version=**origin**/2.0
which is different from the previously suggested simple
version=2.0.0 or something similar...
I have a hunch that this problem occurs only on Windows, I hope someone could kindly confirm this.

Categories