PHP Internals News: Episode 38: Preloading and WeakMaps – Derick Rethans

PHP Internals News: Episode 38: Preloading and WeakMaps

In this episode of “PHP Internals News” I chat with Nikita Popov (Twitter, GitHub, Website) about PHP 7.4 preloading mishaps, and his WeakMaps RFC.

The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml, you can download this episode’s MP3 file, and it’s available on Spotify and iTunes. There is a dedicated website: https://phpinternals.news

Transcript

Derick Rethans 0:16

Hi, I’m Derick. And this is PHP internals news, a weeklish podcast dedicated to demystifying the development of the PHP language. This is Episode 38. I’m talking with Nikita Popov about a few things that have happened over the holidays. Nikita, How were your holidays?

Nikita Popov 0:34

My holidays days were great.

Derick Rethans 0:36

I thought I’d start with something else then I did last year. In any case, and wanting to talk to you this morning about something that happens to PHP seven four over the holidays. And that is issues with preloading on Windows with PHP seven four. I have no idea what the problem is here. Would you try to explain this to me?

Nikita Popov 0:56

So there were actually quite a few issues with preloading in early PHP 7.4 releases. The feature definitely did not get enough testing. Most of the issues have been fixed in 7.4.2. But if you’re using preload-user, what you have to use if you’re running on the root, then you will probably still see crashes and that’s going to be fixed in the next release.

Derick Rethans 1:20

In 7.4.3.

Nikita Popov 1:22

Right. But to get back to Windows, Windows has a well very different process architecture than Linux. In particular, on Linux, or BSD we have fork. Which basically just takes a process and copies its entire memory state to create a new process. This is a lot cheaper than it sounds because it’s all like reuses memory until it’s actually changed.

Derick Rethans 1:48

Its copy on write.

Nikita Popov 1:49

Copy on write exactly. The same functionality does not exist on Windows, or at least it’s not publicly exposed. So on Windows, you can only create new processes from scratch, that look, we use our memory from the previous one. And for OPcache, this is a problem because OPcache would really like to reference internal classes as defined by PHP. But because we store things in shared memory, which is shared between multiple processes, we now have the problem that these internal classes can reside at different addresses, in these different processes. On Linux, it’s always going to be the same address because we are forking and that keeps the address. On Windows each process could have a different address. And especially because Windows since I think Windows Vista, uses address space layout randomization. This is actually pretty much always going to be a different address.

Derick Rethans 2:51

Because that’s a security feature?

Nikita Popov 2:52

Exactly. It’s a security feature.

Derick Rethans 2:54

Would it also be a problem on Linux if you’d start a process instead of forking it?

Nikita Popov 2:59

Truncated by Planet PHP, read more at the original (another 15826 bytes)

A faster website with PHP cache, Redis and Memcached – PHP Scripts – Web Development Blog

Do you have a dynamic website which is built with MySQL and PHP? If your website and audience is growing, there might be a problem with the website’s performance. Without any caching mechanism your website becomes slow if your website gets more visitors than the web server can handle. Do you like to know more […]

Originally published by Web Development Blog

A better website performance with PHP cache, Redis and Memcached – PHP Scripts – Web Development Blog

Do you have a dynamic website which is built with MySQL and PHP? If your website and audience is growing, there might be a problem with the website’s performance. Without any caching mechanism your website becomes slow if your website gets more visitors than the web server can handle. Do you like to know more […]

Originally published by Web Development Blog

PHP 7.2.27 Released – PHP: Hypertext Preprocessor

The PHP development team announces the immediate availability of PHP 7.2.27. This is a security release.All PHP 7.2 users are encouraged to upgrade to this version.For source downloads of PHP 7.2.27 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

PHP 7.4.2 Released – PHP: Hypertext Preprocessor

PHP 7.4.2 Release AnnouncementThe PHP development team announces the immediate availability of PHP 7.4.2. This is a security release which also contains several bug fixes.All PHP 7.4 users are encouraged to upgrade to this version.For source downloads of PHP 7.4.2 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

PHP 7.3.14 Released – PHP: Hypertext Preprocessor

The PHP development team announces the immediate availability of PHP 7.3.14. This is a security release which also contains several bug fixes.All PHP 7.3 users are encouraged to upgrade to this version.For source downloads of PHP 7.3.14 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

Installing Community PHP on IBM i


How to Install Community PHP on IBM i

Now that community PHP is available for IBM i, you may be wondering how to set up the open source operating system on the platform. Unlike the single-step install (RSTLICPGM) that delivers a certified PHP stack as part of Zend Server setup, community PHP requires installation and configuration of multiple packages.