Strict Standards errors since changing servers

Permalink 2 users found helpful
I've been searching for a solution for this and found the ones here which say to add some code to the php.ini file. My host says this creates a security problems so am looking for alternatives.

My goal is to update all my older C5 sites (as I should have long ago) which should correct the errors. The code added to the .htaccess file didn't work for me though.

Any suggestions?

jfuqua
 
goutnet replied on at Permalink Reply
can you state properly the error/problem you are facing ?

if you have strict standard warnings displayed, this is because, somehow, you have turned on the E_STRICT error_reporting of PHP.

Concrete5 is not (yet?) ready for such, and so, you should not use E_ALL or any other combination containing E_STRICT for error_reporting configuration.

in your php.ini you should have this :

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT


Luckily, if you can not (or don't want) to change your global configuration, you can add the following line just before the require in the index.php :

error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT)


which should fix it just the same.
jfuqua replied on at Permalink Reply
jfuqua
Thank you for your reply. I don't own the server so I've not turned on anything as far as I know.

I must admit all this is quite confusing to me but my host said something about being able to set up a local php.ini file. I don't know where such a file needs to go.

I thought a manual upgrade would make things right but having trouble there as well.

I'm giving your code in index.php a try now. Thanks again.
jfuqua replied on at Permalink Reply
jfuqua
Got this error:

error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT)
Warning: session_start(): open(/home/verve/public_html/files/tmp/sess_8db3d2c3692ac0c78e5369474e1b67bd, O_RDWR) failed: Permission denied (13) in /home/verve/public_html/concrete/startup/session.php on line 32

error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT)
<?php 
require('concrete/dispatcher.php');
goutnet replied on at Permalink Best Answer Reply
nope, should be :

<?php 
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
require('concrete/dispatcher.php');
jfuqua replied on at Permalink Reply
jfuqua
Big thanks. Worked perfectly.
jfuqua replied on at Permalink Reply
jfuqua
Your suggestion worked for a fairly new version of C5 but I have one from about two years ago that I also moved to the new server.

This change with the index.php didn't work. Any other suggestions?
goutnet replied on at Permalink Reply
Can you give me a link to that page, so I can see for myself ?
jfuqua replied on at Permalink Reply
jfuqua
You bet. Thanks for taking the time.

http://www.fuquadesign.com
http://www.verveshow.com

Come to find out, I think I was seeing the site on my old server which made me think the code change corrected everything. As you'll see, this problem continues.

I have another C5 site which is working perfectly and, I thought, the same version as the verveshow one showing the errors.
jfuqua replied on at Permalink Reply
jfuqua
I continue to work with this issue and found the verveshow.com site was a site.php error. It is now working as it should.

The other still throws out the session start errors. I don't know if updating it will fix the issue or not so, if anyone had any further ideas, I'd welcome any suggestions.
goutnet replied on at Permalink Reply
the first link is actually pretty broken, it can not find dispatcher.php

That's quite bad, can you check the installation files ? are they here ?

Can you post the content of the index.php please ?
jfuqua replied on at Permalink Reply
jfuqua
I manually updated the site to version 5.5.2.1 and the errors went away.

My index.php code is:

<?php 
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
require('concrete/dispatcher.php');


Thanks again for all your advice.
pixeldevops replied on at Permalink Reply
I was getting the same Warning:Session Start() error on my local dev box (running wamp) as well and followed the goutnets excellent advice but this did not fix my issue. Additionally after a while c5 refused to recognize a new Page type as well.
I did a fresh install thinking Id messed up some data and the error would always come back. Finally I figured that at least one or more of the tools I use such as wamp, eclipse or the Ruby command prompt does something to interfere with the directory tree that my wamp server crazy. Also the error occurred at random intervals, ie refresh the page 3 times, then another 6 times, 2 times, leading me to believe my config file may not have been getting read on every page load?
Also I know that eclipse keeps getting out of sync with the file system, when c5 and or my sass/css files change. All I can say from my observations is once this started happening I could not get rid of the error and things got worse.
Whats worked is Ive done a fresh install and loaded the database from backup, I havent experienced any issues yet. And my new page type was recognized.
pixeldevops replied on at Permalink Reply
I was getting the same Warning:Session Start() error on my local dev box (running wamp) as well and followed goutnets excellent advice but this did not fix my issue. Additionally after a while c5 refused to recognize a new Page type as well.
I did a fresh install thinking Id messed up some data and the error would always come back. Finally I figured that at least one or more of the tools I use such as wamp, eclipse or the Ruby command prompt does something to interfere with the directory tree that my wamp server crazy. Also the error occurred at random intervals, ie refresh the page 3 times, then another 6 times, 2 times, leading me to believe my config file may not have been getting read on every page load?
Also I know that eclipse keeps getting out of sync with the file system, when c5 and or my sass/css files change. All I can say from my observations is once this started happening I could not get rid of the error and things got worse.
Whats worked is Ive done a fresh install and loaded the database from backup, I havent experienced any issues yet. And my new page type was recognized.
siteadvice replied on at Permalink Reply
siteadvice
I've just had to move a couple of Concrete5 sites running v5.4.X and I had a lot of trouble with this.

The supposed fix reported by several people on the forums (adding the error_reporting setting to a php.ini file in the site root) does not solve the problem because error_reporting is reset numerous times in the core Concrete5 code itself.

The solution for me was to search through the \concrete\ folder and find instances of

error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED)

or

error_reporting(E_ALL ^ E_NOTICE)

(for example in concrete\startup\debug_logging.php and concrete\controllers\upgrade.php)

and change them to the following:

error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE)

This got my sites running again.
Korvin replied on at Permalink Reply
Korvin
I've updated the documentation for fixing this issue. Interestingly the fix offered in here is not complete.

http://legacy-documentation.concrete5.org/tutorials/how-fix-strict-...