Why is twig_template_get_attributes() throwing a fatal error? - php

I have twig installed via composer on a new codebase I'm working on (OSX), and on a new server I was trying install my app on. I started getting a fatal error on twig_template_get_attributes()
namely
PHP Fatal error: Call to undefined function twig_template_get_attributes() in /<path_to_here>/templates_c/a2/4e/3fbd69b54a0875d7cd3744d62bf1fa98ed4e7b1b375f904ead10b7cb27b6.php
I don't have this problem locally (OSX), and I was trying figure out why this is happening on my other server (Ubuntu 12.04 if that matters). When I install twig as a PHP extension the problem goes away, but my understanding is that the extension is completely optional and only optimizes one call
as per the documentation
The C extension is optional but it brings some nice performance
improvements. Note that the extension is not a replacement for the PHP
code; it only implements a small part of the PHP code to improve the
performance at runtime; you must still install the regular PHP code.
and
And from now on, Twig will automatically compile your templates to
take advantage of the C extension. Note that this extension does not
replace the PHP code but only provides an optimized version of the
Twig_Template::getAttribute() method.
very confused about this behavior.

Related

Wordpress 5.6 does not support PHP 8?

Scenario
I had installed php8 and wordpress 5.6 locally over my computer.
Problem
When I run the wordpress, I get Fatal Error.
Question
Anyone of you facing the same problem and how did you solve it? Thanks
Your PHP 8 installation does not have a mysqli extension installed.
See possible dupe: Wordpress Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /wp-includes/wp-db.php:1570
I kind of wish WordPress would tell you explicitly that it's missing a usable database extension. The major indicator is the error message itself where WordPress tries to call mysql_connect which was removed ages ago.
WordPress 5.6 core appears to run correctly on PHP 8. Though, the same might not be true of plugins (yet), so you'll want to test them individually.
[Edit] WordPress's database abstraction is written to use either the mysql or mysqli extensions, but the mysql extension was removed in PHP 7.0. The abstraction library does not support PDO, so even if you have the PDO MySQL driver, WordPress will not use it.
Edit: And to demonstrate a reproduction of the error, I took the same install, but rebuilt my Docker image without the mysqli extension:

ezSQL compiling issue on PHP V7

I've been developing my PHP Apps based on ezSQL class since 2000s. Unfortunately, I have depended on this class ever since. It was fine until I realized that this class isn't valid for servers running PHP 7+. When I run my App on servers running PHP 5.6 and below it works fine. Any other version above PHP 5.6 would give me this error:
Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine
Unfortunately, the one who did this great class isn't working on it anymore since a long time. Is there any way around to fix this?
You are probably using the old ezSQL class, it uses libmysqlclient. PHP 7 no longer uses libmysqlclient, leaving the old version of ezSQL useless. Upgrade to the new version of ezSQL or access this project that updated the old class adapted for MySQLi.

TYPO3 PHP Runtime Deprecation Notice:

i have a problem with some old TYPO3 stuff, i tried to make a old TYPO3 Website run on my Ubuntu system.
And sorry if somethings are not clear to understand for me, i am new in CMS's and i am forced to change some stuff on a old page.
Problems are:
1.
Backend seems working, half. If i enable the ext. TemplaVoila my be Page module shows me a white page.
On TV disable,
Page module, seems working but it gives me some strange error messages inside the content fields.
if i try to look at the front-end it gives me this exception:
1: PHP Runtime Deprecation Notice: Non-static method tx_ttnews_div::getSubCategories() should not be called statically,
assuming $this from incompatible context in
/var/www/projectfolder/projectfolder-typo3/typo3conf/ext/tt_news/pi/class.tx_ttnews.php
line 3740
Just apart from this, i read about a removed php feature in update 5.6 i was using currently.
Things i checked already:
-Correct PHP -v
-Database import correct
-LocalConf correct (took from live server and changed for my localhost)
-Checked install-tool and rm -rf * inside typo3temp folder
Thanks for you help
Your PHP version combined with the versions of TYPO3 and extensions seems to be incompatible. You either need to use a different PHP version or upgrade TYPO3 and/or the extensions being used. FYI, the method being called is from a very old extension so although you don't say which version you're using, I assume your TYPO3 version is very old (either 6.x or even 4.x versions).
The normal recommendation would be to upgrade TYPO3 and any extensions. The less recommended alternative would be to use a different PHP version. But please be aware that remaining on older TYPO3 versions means your site may not be patched for security issues and may not be compatible with modern browsers.

ionCube loader error on Azure IIS

I had the ionCube Loader working and running on an Azure web app for a few months. Then, about a week ago, PHP started throwing a fatal error regarding ionCube out of the blue. Haven't gotten it to work since. I didn't touch the server for several days prior to this error appearing.
PHP Error:
PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0
I know this is usually caused by the wrong order of loading PHP extensions. Since I'm on Azure, I cannot fix the loading order in the usual way, since I have no direct access to the php.ini.
It was also working just fine for quite a long time.
My entry in Application Settings:
PHP_ZENDEXTENSIONS bin\ioncube_loader_win_5.5.dll
Any suggestions? Any more information I can provide?
UPDATE: After updating ionCube Loader, PHP now works. The loader doesn't show up as loaded in phpinfo however, and apps using it still can't pick it up. The Loader Wizard gives essentially the same error as I had before:
The ionCube Loader must be the first Zend extension listed in the configuration file, D:\local\Config\PHP-5.5.22\php.ini.
You can load your custom php runtime on Azure Web App. Instructions can be found here under "How to: Use a custom PHP runtime" section
https://github.com/Azure/azure-content/blob/master/articles/web-sites-php-configure.md
Once you configure custom php runtime, you can use your custom php.ini file in which you can define the order of loading for your extensions. Instructions on how to use custom php.ini can be found here:
https://github.com/projectkudu/kudu/wiki/Xdt-transform-samples#using-a-custom-phpini

Old php site not working on new IIS server, need to use GD library but can't figure it out

I have been developing our php based site on a development box that was set up when i started my new job a few months ago. I have just got a new dev box and am having some real trouble getting my IIS server to work with the site.
I am running windows 7 64bit and IIS7.
I get this error when trying to load the site:
Fatal error: Call to undefined function imagecreatefromgif() in filepath:// line:#
I have done some searching around and found that this particular function is part of the GD library and that i needed to enable it in the php.ini file. most sites were saying that i needed to uncomment this line extension=php_gd2.dll but it wasn't there, so i added it. I took the php_gd2.dll file from the old test box and put it in the folder specified as so
extension_dir ="C:\Program Files (x86)\PHP\v5.2\ext"
I should point out that I am using php5.2 by necessity, we use a library called ezpdf to create pdfs and it contains hundreds of references to magic_quotes_runtime the old dev box was actually running php5.0 but i couldnt find anything earlier than 5.2, and as far as i can tell the magic quotes things should be an issue before php5.3.
Anyway, using the php manager in IIS7, i can see that php_gd2.dll is enabled, however if i look at phpinfo() i can see no reference to GD.
No matter what i try i get the same error, does anyone have any ideas!?
GD isn't JUST the .dll you load into php. there's a fair chunk of other code in other libraries that the php .dll references. You'll need the entire GD setup for it to work in IIS, not just the one php_gd.dll.
References to magic_quotes_runtime by themselves aren't 'bad' - a lot of libraries have to handle running under older PHP versions where magic_quotes is enabled by default, and do appropriate compensation for that fact. If ezpdf is, however, recreated magic_quotes behavior, then it's definitely time to upgrade versions or switching to something better. magic_quotes is deprecated for a reason, and re-enabling it in any way/shape/form is a bad idea.

Categories