Category: php

vtiger: Sorry! Attempt to access restricted file. After moving it

11:50 AM by admin

Filed under php

Last modified Thursday June 2nd, 2016

You get the message “Sorry! Attempt to access restricted file.” from vtiger after you have moved it to another path or even another server?

PHP Fatal error: Class ‘tslib_cObj’ not found

03:54 PM by Christian Koch

Filed under php, t3 extension development

Last modified Wednesday September 9th, 2015

when you get the error "PHP Fatal error: Class 'tslib_cObj' not found" go to the file displayed in your error log and replace tslib_cObj with \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer

PHP Fatal error: Class ‘t3lib_div’ not found

02:56 PM by Christian Koch

Filed under php, t3 extension development

Last modified Wednesday September 9th, 2015

when you get the error "PHP Fatal error:  Class 't3lib_div' not found" go to the file displayed in your error log and replace t3lib_div with \TYPO3\CMS\Core\Utility\GeneralUtility

PHP Fatal error: Class ‘tslib_pibase’ not found

02:48 PM by Christian Koch

Filed under php, t3 extension development

Last modified Wednesday September 9th, 2015

When you receive this error in TYPO3 6 or 7 go to the error file and replace class whatever extends tslib_pibase, the tslib_pibase with \TYPO3\CMS\Frontend\Plugin\AbstractPlugin

PHP email subject encoding UTF-8

11:38 AM by Christian Koch

Filed under php

Last modified Tuesday September 8th, 2015

To fix the encoding of email subject that you send with PHP wrap your subject in '=?UTF-8?B?' / "?=" and also use the PHP function base64_encode() to encode your original subject. Check out the code sample:

Eclipse PHP – Set maxiumum line width

02:07 PM by Christian Koch

Filed under Eclipse, php

Last modified Tuesday July 29th, 2014

Open preferences window and go to PHP -> Code Style -> Formatter and there you click on "Edit..." of the current selected profile: Now go to the tab called "Line Wrapping" and there set the field "Maximum line width" to your wished line width: After click on the tab called "Comments" and there set the field "Maximum line width for comments" also to 120: Click ...

PHP Get first and last date of month

09:57 AM by Christian Koch

Filed under php

Last modified Thursday April 17th, 2014

Learn how to get the first and last day of a month.

PHP SimpleXML – create XML

05:08 PM by Christian Koch

Filed under php

Last modified Wednesday April 2nd, 2014

Here’s the snippet to create some xml with PHP’s SimpleXML Lib: