MAMP php5 strict standards - mamp

I am trying to set error_reporting to E_ALL & ~E_STRICT in php.ini of mamp.
But this is not getting affected at all. I confirmed that I am editing right file by setting different error_reporting like E_NOTICE and checked phpinfo to verify the same.
But only ~E_STRICT is not happening.
When I visit my cms (concrete5) it gives me a list of strict errors ( pasting first few below ):
Strict Standards: Non-static method Cache::get() should not be called statically in www/concrete/models/package.php on line 78
Strict Standards: Non-static method Cache::key() should not be called statically in www/concrete/libraries/cache.php on line 117
Strict Standards: Non-static method Cache::getLibrary() should not be called statically in www/concrete/libraries/cache.php on line 121
tried to set error_reporting to E_ALL & ~E_STRICT in .htaccess and also index.php file. none worked.
Solution please.

Concrete5 has a setting that will suppress display of errors and warnings (and notices I presume) -- in the Dashboard -> System & Settings -> Environment -> Debug Settings.
It's possible that you have this set to hide all errors/warnings -- which will override your settings in the config file.
As for #PeeHaa's comment about suppressing errors instead of fixing them, well it's not as simple as that because the Concrete5 CMS itself has a TON of php that will generate notices. I assume this is because of code that was written years ago before certain things were deprecated. For example, there are a ton of system functions that get called statically even though the function is not declared as "static". This was an okay thing to do in older versions of PHP but is now frowned upon. Unfortunately I don't think there's anything you can do about this.
This is unfortunately one of the trade-offs with using Concrete5. It's the best CMS out there, but it is not always the most sophisticated platform for more advanced developers.

It's very tricky to get Concrete5 to ignore these errors and load a page (including the Dashboard). Your best bet is to downgrade PHP to the latest 5.3.X until a PHP 5.4.X compatible version is released.

I got this resolved by moving from mamp to xampp on my imac.
issue with mamp:
it does not allow us to use php 5.3 unless we have mamp pro
solution that I used:
I moved to xampp with php 5.3 and everything worked smooth.

If MAMP appears to be ignoring settings in php.ini (eg. E_STRICT) then chances are you are not editing the correct file. You can see which config file is being loaded with phpinfo();
Look for this line:
Loaded Configuration File: /Applications/MAMP/bin/php/php5.4.4/conf/php.ini
Notice how it is in MAMP/bin on my machine. With the default MAMP installation it is easy to mistake the template config files for live config files.
E_STRICT is not ignored by MAMP when set in the correct place.

Related

Typo3 broken: Frontend / Backend blank pages and no errors even after restoring backup

I was fixing things on a not well-maintained typo3 installation and it resulted in blank pages of frontend, backend and install tool.
I wanted to fix extensions because the powermail-extension was not working anymore even after updating to latest compatible version (tried emptying cache and database compare).
I deactivated an extension "compatibility6" to see if it was interfering and since then all pages have been blank including Install Manager. I reactivated the extension via PackageStates.php, emptied the cache but it did not change anything. I was not able to see any error messages even though I set the parameter in LocalConfiguration.php which made it hard to try to find out what is wrong. Then I restored a backup using vmware. Still, backend and frontend are blank.
I am using Apache and Typo3 7.6.23.
I do not know what might be causing the problem and would like to know what else to look for?
It means you have a PHP error there. The first thing would be to examine logs. If you see anything like "class not found", then your next action would be composer dumpautoload --no-dev.
Long time ago I had an article about blank pages in TYPO3 FE. Not up to date but still can be helpful: https://www.dmitry-dulepov.com/2009/03/blank-empty-page-in-typo3.html
Dmitry already wrote it: you have an error.
In production environment nothing is shown for not revealing any information about your system.
So the only information about the error can be found in the error log of your webserver.
What can you do to get more information about your error?
Enter the install tool and switch to develop mode. This will also enable deprecation logging into a file. Try to avoid filling your system with deprecation warnings by disabling deprecation logging.
Disable the default exceptionhandler by adding this to your typoscript setup:
config.contentObjectExceptionHandler = 0
Now you should see a call stack instead of blank screens.
Be aware that this might reveal confidential information from your system.
because of this you should use a copy of the live-system.

typo3 8.7.9 - download language package and update extension list failed

I already installed TYPO3 8.7.9, changed the language to german but can't download the language pack. It says:
Error
The request has failed.
Also if I change the dropdown in Extensions to Get Extensions it says:
Update Extension List
Could not access remote resource https://repositories.typo3.org/mirrors.xml.gz
I'm using MAMP on Windows 7. Also in the System environment check there are four orange issues which - I thought - already fixed in the php.ini:
Low PHP script execution time
PHP max_input_vars very low
Windows apache thread stack size
PHP extension fileinfo not loaded
Do you think it had something to do with "curl"? It often appears during my Google research.
I would be pleased if someone could help me :)
I can access this file via browser, so it's available. A missing curl could be the problem, you're right.

Enable preset plugins in Ckeditor 4.5.8

I am using CKeditor via cdn //cdn.ckeditor.com/4.5.8/full/ckeditor.js.
I wish to enable a preset plugin and do not know how to go about it. i need clear code example.
I have seen this tutorial on using the cdn but it talks about local plugins.
Code snippet is one of the plugins I want to enable.
Working locally with CKeditor in laravel 5.2 is a lot of headache. I keep have this error SyntaxError: illegal character when I inmport my javascript files. My laravel view uses blade template engine. I do not have this issues with CDN imports.
I resolved the issue after many days. all the javascript(not only Ckeditor or Tinymce) files I imported in laravel always gave the syntaxError: illegal character like this
I notices that in every response a header information was automatically pasted as well as a funny character. I solved this using two major steps.
I opened all the javascript files using notepad++ and deleted the first line (usually comments) using backspace and type it back manually, then saved the files.
I realized the header info HTTP/1.1 200 OK was some how related to the server configuration. I switched form using the in-built server php artisan serve to virtual host on xampp. And everything works well.
NB: This problem has nothing to do with Laravel 5.x. I personally think that this problems arise due to the copying and pasting, and downloading of files from the server.
To benefit from the advanced features of a full flesh server, I decided to use virtual host in xampp for development.
I am very happy. Hope it helps!

Endless 'Loading...' message after Login in Sugar 7.2.1

I am using the latest commercial version of SugarCRM, with 7.2.1 in Ubuntu 14.04.
I have logged-in to the sugar and it shows Endless 'Loading...' message. And there is one Fatal Error in my console i.e., TypeError: error.payload is undefined at cache/include/javascript/sugar_sidecar.min.js?v=v05JhcpoUqgUDSTVs1g86g on line 599"
I've seen this endless 'Loading...' message appear when some of the file & folder permissions are incorrectly set. The article here has resolved it for me: http://support.sugarcrm.com/04_Find_Answers/02KB/02Administration/100Install/Required_File_System_Permissions_on_Linux/
Ben.
Endless loading can be caused by a number of things, probably all of them JavaScript issues. The last few I encountered had to do with accessing the cached javascript files. Make sure you have mod_rewrite enabled if you're using Apache, and that .htaccess has the RewriteBase setting correctly pointing to the site. Also check config.php that site_url is correct.
The SugarCRM PHP code is horrendous and generates loads of errors (warnings/notices/etc.)
I would add the following, either in your Apache settings or the .htaccess file in the root directory of SugarCRM.
# Avoid all those strict warnings
php_value error_reporting 0
This technically turns off all the warnings and notices, some of which would be transformed to errors as your question seems to show.

Symfony, netbeans 6.8 and debugging a web page

I am using Symfony (1.31) - with Propel ORM to build a website. I have recently moved from using a text editor, to Netbeans (6.8) as my dev environment.
Coming from a compiled language (C++) background, I am used to setting break points in code etc as part of debugging. Web development I have encountered (atleast with PHP), has been largely hit and miss - well debugging has been messy to say the least, using echo statements, logging stuff to file etc. Well I hear that it is possible to debug PHP (i.e. set breakpoints etc).
I have scoured the net for documentation to show how to set breakpoints (say in one of the MVC layesrs) so that when the relevant page(s) is opened via a browser, the breakpoint will get hit and I can step through the code (ideally, watching the program variables).
Is this possible using Symfony and Netbeans 6.8?.
There seems to be support for XDebug: http://netbeans.org/kb/docs/php/debugging.html
If you have specific questions about configuring XDebug: http://wiki.netbeans.org/HowToConfigureXDebug.
More useful articles on PHP development in NetBeans: http://netbeans.org/kb/trails/php.html.
Hope that helps.
UPDATE: Just installed NetBeans 6.8 and ran through the configuration and was able to get breakpoints to work successfully with XDebug. NetBeans' integration with Symfony is pretty slick too, +1 to question for getting me to check this out.
Here is what has helped me debug my Symfony apps:
Enable logging and the web debug toolbar via apps/appname/config/settings.yml. Note: Any changes will require clearing the cache.
dev:
.settings:
web_debug: true
logging_enabled: true
Use var_dump() or print_r() with pre tags to dump data from anywhere. Adding exit; will allow you to dump variables from the controller or anywhere else.
echo '<pre>';
vardump($something);
echo '</pre>';
exit;
Enable logging and log messages. You can access the logger anywhere as well, but make sure you enable logging for your environment:
sfContext::getInstance()->getLogger()->info($message);
I've used Gubed with Quanta+ as a stepping debugger with PHP, don't know if you can get that to work with Netbeans but I thought it was more hassle that it was worth. I found that I could for(i=0;i<~6;i++){dump stuff to screen/log; make changes; reload;} and solve an issue in less time than it took me to step through it once with the debugger.
Xdebug is a very useful PHP extension which features a remote debugger with support for some editors, though Neatbeans isn't listed. I've not used the remote debugging element of Xdebug (see above) but the profiling, code coverage and - in particular - improved browser error messages I find helpful.
Generally with Symfony I find I can get most of what I need from stack traces or by dropping items into the logger and picking them up with either the debug toolbar or firesymfony.
Netbeans 7+ has trouble with xdebug breakpoints in the model/action. You have to use the manual function to set breakpoints.
xdebug_break();