<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted]]></title><description><![CDATA[<p dir="auto">my Shaarli app on Cloudron frequently throws 500 while loading the frontend.<br />
everytime this occurs I see this in Shaarli log: <code>Mar 04 14:40:58 [Tue Mar 04 13:40:58.352043 2025] [php:error] [pid 46] [client 172.18.0.1:36306] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 9235624 bytes) in /app/code/application/bookmark/BookmarkIO.php on line 93</code></p>
<p dir="auto">I tried to increase the memory limit via Cloudron allocated resources and php.ini without improvement.</p>
<p dir="auto">I've also opened an issue in Shaarli repo: <a href="https://github.com/shaarli/Shaarli/issues/2130" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/shaarli/Shaarli/issues/2130</a> because this I/O intensive operation for loading such a small DB (9K links) is unbelievable.<br />
I know CLoudron hardcodes this memory limit : <a href="https://git.cloudron.io/packages/shaarli-app/-/blob/master/Dockerfile?ref_type=heads#L31" target="_blank" rel="noopener noreferrer nofollow ugc">https://git.cloudron.io/packages/shaarli-app/-/blob/master/Dockerfile?ref_type=heads#L31</a> so I first thought that my changes made to php.ini were not taken into account. I wonder also how to double check if those are really taken into account?</p>
<p dir="auto">Yet I also notice that Shaarli codebase contains a init.php file that hardcodes the memory limit to 128M : <a href="https://github.com/shaarli/Shaarli/blob/master/init.php#L18" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/shaarli/Shaarli/blob/master/init.php#L18</a> so I also wonder if Cloudron php.ini makes sense.</p>
<p dir="auto">Thanks for your help!</p>
]]></description><link>https://forum.cloudron.io/topic/13382/app-crashing-frequently-throws-500-error-php-fatal-error-allowed-memory-size-of-134217728-bytes-exhausted</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 04:14:32 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/13382.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Mar 2025 13:47:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Thu, 29 May 2025 11:31:13 GMT]]></title><description><![CDATA[<p dir="auto">For the sake of completion,<br />
The UptimeKuma chart for past week show a huge gain in responsiveness and stability since after disabling completely the plugin.</p>
<p dir="auto"><img src="/assets/uploads/files/1748518263770-1000087733-resized.jpg" alt="1000087733.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.cloudron.io/post/107884</link><guid isPermaLink="true">https://forum.cloudron.io/post/107884</guid><dc:creator><![CDATA[SansGuidon]]></dc:creator><pubDate>Thu, 29 May 2025 11:31:13 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Wed, 28 May 2025 20:55:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> This can be flagged as solved.</p>
]]></description><link>https://forum.cloudron.io/post/107853</link><guid isPermaLink="true">https://forum.cloudron.io/post/107853</guid><dc:creator><![CDATA[SansGuidon]]></dc:creator><pubDate>Wed, 28 May 2025 20:55:45 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Wed, 28 May 2025 20:51:56 GMT]]></title><description><![CDATA[<p dir="auto">Hey, I've an update to report on this:<br />
I had recently lot of crashes of my Shaarli instance that I couldn't explain nor troubleshoot. I was also convinced I should migrate away from Shaarli to fix my suffering. But with patience and being stubborn, come great success! A Shaarli plugin was it seems causing lot of troubles: <a href="https://github.com/ilesinge/shaarli-related" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/ilesinge/shaarli-related</a>, this plugin was causing memory exhausted issues on many pages of Shaarli.<br />
Disabling it solved all my php memory exhausted issues.</p>
<p dir="auto">Hope it helps!</p>
<p dir="auto">Related GH issues:</p>
<ul>
<li><a href="https://github.com/shaarli/Shaarli/issues/2130#issuecomment-2917570457" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/shaarli/Shaarli/issues/2130#issuecomment-2917570457</a></li>
<li><a href="https://github.com/shaarli/Shaarli/issues/953#issuecomment-2917561291" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/shaarli/Shaarli/issues/953#issuecomment-2917561291</a></li>
</ul>
]]></description><link>https://forum.cloudron.io/post/107852</link><guid isPermaLink="true">https://forum.cloudron.io/post/107852</guid><dc:creator><![CDATA[SansGuidon]]></dc:creator><pubDate>Wed, 28 May 2025 20:51:56 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Mon, 17 Mar 2025 21:51:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sansguidon" aria-label="Profile: SansGuidon">@<bdi>SansGuidon</bdi></a> I think it makes sense to move the package to php-fpm . We will look into that</p>
]]></description><link>https://forum.cloudron.io/post/103535</link><guid isPermaLink="true">https://forum.cloudron.io/post/103535</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 17 Mar 2025 21:51:51 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Mon, 17 Mar 2025 13:27:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> As mentioned before, Shaarli hardcodes the memory limit in their init.php. I did not realize that Shaarli maintainer wasn't aware of that. Yet they suggest adjusting the way Cloudron packages Shaarli. <a href="https://github.com/shaarli/Shaarli/issues/2130#issuecomment-2726974132" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/shaarli/Shaarli/issues/2130#issuecomment-2726974132</a></p>
<p dir="auto">Quoting the GitHub discussion:<br />
@nodisc said in <a href="https://github.com/shaarli/Shaarli/issues/2130#issuecomment-2726974132" target="_blank" rel="noopener noreferrer nofollow ugc">App frequently returns 500 error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (cloudron) #2130</a></p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sansguidon" aria-label="Profile: SansGuidon">@<bdi>SansGuidon</bdi></a> wow, I had no idea this was actually in the code (and always has been), and on my setup (apache+php-fpm) it doesn't have any effect (memory_limit stays at 256M), but I suspect it does with Cloudron's setup which still uses the deprecated apache2+mod_php setup.<br />
Before moving forward, I suggest that cloudron's packaging should be modernized to use php-fpm + apache mpm-event which has many advantages</p>
</blockquote>
<p dir="auto">They suggest that we verify this by hacking the init.php of Shaarli and remove the ini_set but I can't do that as init.php is part of <code>/app/code</code> and I do not want to break Shaarli on my Cloudron <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=fed68e33a46" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Any idea to move this forward?</p>
]]></description><link>https://forum.cloudron.io/post/103483</link><guid isPermaLink="true">https://forum.cloudron.io/post/103483</guid><dc:creator><![CDATA[SansGuidon]]></dc:creator><pubDate>Mon, 17 Mar 2025 13:27:23 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Thu, 06 Mar 2025 09:00:06 GMT]]></title><description><![CDATA[<p dir="auto">So far, no crash during the night <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f57a.png?v=fed68e33a46" class="not-responsive emoji emoji-android emoji--man_dancing" style="height:23px;width:auto;vertical-align:middle" title=":man_dancing:" alt="🕺" /> . I'm now testing if lowering the memory allocated to this app by Cloudron will make things worse. Like going back to something like 256M instead of 1G.</p>
]]></description><link>https://forum.cloudron.io/post/102692</link><guid isPermaLink="true">https://forum.cloudron.io/post/102692</guid><dc:creator><![CDATA[SansGuidon]]></dc:creator><pubDate>Thu, 06 Mar 2025 09:00:06 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Wed, 05 Mar 2025 23:37:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> thanks for the package update, it might have improved the stability as despite sress testing the shaarli app after updating I didn't face the same error as before. I consider that if this resolves the problem it is a big victory, yet I prefer to not jump to conclusions for now, a good night is needed it the problem is not solved, I should soon get new alerts. Otherwise then I'll mark the issue as solved (hopefully) <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f64f.png?v=fed68e33a46" class="not-responsive emoji emoji-android emoji--pray" style="height:23px;width:auto;vertical-align:middle" title=":pray:" alt="🙏" /></p>
]]></description><link>https://forum.cloudron.io/post/102674</link><guid isPermaLink="true">https://forum.cloudron.io/post/102674</guid><dc:creator><![CDATA[SansGuidon]]></dc:creator><pubDate>Wed, 05 Mar 2025 23:37:59 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Wed, 05 Mar 2025 09:48:02 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a></p>
<p dir="auto">I've already pushed the memory limit up to 1G yesterday without help<br />
What I did try is to edit php.ini with something like</p>
<pre><code>disable_functions = ini_set
auto_prepend_file = /app/data/init.php
</code></pre>
<p dir="auto">and the <code>init.php</code> was a custom hack looking like</p>
<pre><code>&lt;?php
$original_ini_set = 'ini_set';
function ini_set($option, $value) {
    if ($option === 'memory_limit') {
        return false;
    }
    return call_user_func_array($GLOBALS['original_ini_set'], func_get_args());
}
call_user_func($original_ini_set, 'memory_limit', '512M');
error_log("Prepend file loaded and memory_limit set to " . ini_get('memory_limit'));
</code></pre>
<p dir="auto">I don't recall all the different versions of the setting I've tried as it was passed midnight but at some point I could work around the hardcoded memory limit of 128M as defined in Shaarli init.php. Yet that didn't solve the root cause <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=fed68e33a46" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":-(" alt="😞" /></p>
<p dir="auto">but even if I could see an effective increase of memory limit used by Shaarli at runtime, so completely ignoring what was hardcoded in init.php , that didn't improve the situation</p>
]]></description><link>https://forum.cloudron.io/post/102640</link><guid isPermaLink="true">https://forum.cloudron.io/post/102640</guid><dc:creator><![CDATA[SansGuidon]]></dc:creator><pubDate>Wed, 05 Mar 2025 09:48:02 GMT</pubDate></item><item><title><![CDATA[Reply to App crashing frequently throws &quot;500&quot; error - PHP Fatal error: Allowed memory size of 134217728 bytes exhausted on Wed, 05 Mar 2025 09:08:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sansguidon" aria-label="Profile: SansGuidon">@<bdi>SansGuidon</bdi></a> I can update PHP to 8.3 and see if that helps.</p>
<p dir="auto">One angle is: shaarli runs with a memory limit at container level. apache spins out processes and each of this has a php limit. It is possible that if apache spins say 5 processes, then 5*128MB &gt; container limit . So, can you try adjusting the app memory limit to say 800MB and checking if that helps ? If that's the case, we can also adjust the package to use a better default memory limit.</p>
]]></description><link>https://forum.cloudron.io/post/102636</link><guid isPermaLink="true">https://forum.cloudron.io/post/102636</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Wed, 05 Mar 2025 09:08:42 GMT</pubDate></item></channel></rss>