getting 'zend_mm_heap' message on composer update when including browscap.ini - php

I want to utilize PHP's get_browser() function, so I have included browscap = extras/lite_php_browscap.ini in my php.ini file.
I am running:
PHP 7.0.15 (cli) (built: Jan 17 2017 13:44:27) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15, Copyright (c) 1999-2017, by Zend Technologies
My website still works, and get_browser() is working great... but when I go do a composer update, I am getting a big red zend_mm_heap corrupted error message.
I've tried setting opcache.fast_shutdown=0, and even turning off opcache altogether, and that doesn't fix it.
The weird thing is, I have this same setup up on my dev server, and it works fine. The only difference I can see is that I'm running PHP 7.0.18 there.
Any ideas why this is happening, and how I can try to avoid it? Thanks!

Related

composer always detect wrong version of my local php

Whenever I try to test PHPUnit or composer update, I get this error:
PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.19
but when I put on the terminal: source ~/.bash_profile it reads that I have 7.4 on my local machine and all works OK. Is there any solution for that issue, to not need to put every time that command source ~/.bash_profile before every start of the console?
Before run source ~/.bash_profile:
PHP 7.3.19 (cli) (built: Jun 12 2020 00:29:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19, Copyright (c) 1999-2018, by Zend Technologies
After run source ~/.bash_profile:
PHP 7.4.13 (cli) (built: Nov 30 2020 14:57:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
I was facing the same issue, I was using command prompt for laravel artisan commands. Which was showing wrong php version. I closed it and from Xampp Control Pannel Open the Shell for artisan commands and now its detecting the correct PHP Version. It fixed my problem.

How to upgrade PHP 7.0.27 to 7.3 on Google Cloud?

I have been trying to upgrade the current version of PHP (7.0.2) to 7.3.
I have tried this method here which helped me install v7.3, but it does not get activated.
Here's what else I tried:
I stopped and started VM Instance
I restarted apache2
Tried locating app.yaml to modify the PHP runtime specified here, but couldn't find it.
I tried reinstalling apache since it was giving some error
But none of these helped. I also read here that it's not possible without migrating to a new instance, which truly is a pain and I would want to avoid that at all costs.
Now sure what I should share so here are some stuff:
This is what I get for php -v
$ php -v
PHP 7.0.27 (cli) (built: Jan 19 2018 12:12:50) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27, Copyright (c) 1999-2017, by Zend Technologies
Am I missing out on something very obvious?
I am not much of a coder, so be gentle :P
In your app.yaml add:
runtime: php73
GCP - PHP 7 Runtime Environment

phpldapadmin not loading php

For some reason my phpldapadmin doesn't want to work with my website and it says "If you are seeing this in your browser, PHP is not installed on your web server!!!" Which is not true as if the info.php file is navigated to like here it says php is enabled along with the ldap extension. The apache error log doesn't say anything about the error though.
Every other php page on my website works except phpldapadmin. I am really confused.
This is what I get when I run php -v
PHP 7.1.1-1+deb.sury.org~xenial+1 (cli) (built: Jan 20 2017 09:20:20) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.1-1+deb.sury.org~xenial+1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
Your webserver's document root is /var/www/html and you have to place everything within this folder (may use subfolders /var/www/html/phpmyadmin, /var/www/html/phpldapadmin, etc.). Or you can define alias for certain purposes which can point to a folder outside document root. How to config an alias: https://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias
Everything else what's outside isn't accessible by webserver itself and neither can be processed by PHP.

Apache php module behaving strange after update

I recently updated my linux mint via the automatic updater. I had the problem, that it did not execute php scripts. After re-installing libapache-mod-php5 some php started to work. Yes, just some, as phpinfo() is executing properly, but another php file, which works correctly on other machines, and was working on mine too, is now producing the following error in resopnse to an $.ajax call: status: parsererror errSyntaxError: Unexpected token <. what happens is it returns the php file without executing it, even though it executes other php files.
My configs are the following:
Server version: Apache/2.4.6 (Ubuntu)
PHP 5.5.1-1~precise+1 (cli) (built: Jul 22 2013 07:33:14)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.2-dev, Copyright (c) 1999-2013, by Zend Technologies
The problem was that after the update the php.ini got overwritten and it was not interpreting shortcode. The solution is to set
short_open_tag=On
in the php.ini as suggested here.

How to update PHP CLI OSX?

I just updated to php 5.4 using http://php-osx.liip.ch/ on osx lion.
when i type:
php -v
i still see:
PHP 5.3.15 with Suhosin-Patch (cli) (built: Jul 31 2012 14:49:18)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
But phpinfo() shows 5.4.
How do i update this?
Just Export installed PHP path ,type this on Terminal
export PATH=/usr/local/php5/bin:$PATH
I checked that /usr/local/php5/bin/php existed. It did, so I added /usr/local/php5/bin to my PATH.
Thank you #AD7six
The answer shared by both Chutipong Roobklom and user1168427 helped, if you want to update to the latest php cli which is 7.2.7 (most current and stable release as of 2018 when this post was created originally so check the latest php version, methods for switching versions may vary) then just use this instead of the php5 command. export PATH=/usr/local/php7/bin:$PATH then type php -v and you should have something that reads like this(on MACOSX by the way):
PHP 7.2.7 (cli) (built: Jun 22 2018 06:27:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.7, Copyright (c) 1999-2018, by Zend Technologies
so you shouldn't be getting any errors. Hope this helps and for Kamel, that is how it is installed. You're kind of 'exposing' it in a way for your machine to now recognize which php version you are using.

Categories