Page 1 of 1
Error with many pictures ...
Posted: Tue Jun 17, 2008 1:12 pm
by Lux
Hi,
months ago, I copied a gallery of free pictures to my serendipity installation. Over time some pictures were added to the media database. When I now try to update the preview, I get a
Code: Select all
Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 24 bytes) in /srv/www/deimeke.net/dirk/blog/include/db/mysql.inc.php on line 135
I think it is a php setting. Which value do I have to increase to get rid of the message?
Second: How can I find out which pictures (of some thousand) are used in my blog?
Thanks for your support
Dirk
Re: Error with many pictures ...
Posted: Tue Jun 17, 2008 1:16 pm
by garvinhicking
Hi!
This can happen if the automatic media synchronisation of s9y is executed and needs to parse all pictures inside your directory tree. This might require a lot of RAM, depending on your picture files.
You can increase the php.ini setting "memory_limit" to get rid of that. Remember to restart apache if you change it to be sure that it gets applied.
Second: How can I find out which pictures (of some thousand) are used in my blog?
S9y offers a way to track referenced images. But you would need to have used that before -- it will not work if you enable that now.
So the only way for you is to check your serendipipity_entries DB table and see which images you linked to. You could automate that with a small PHP script that matches all your <img> links and looks them up if they match in the DB...
Regards,
Garvin
Re: Error with many pictures ...
Posted: Tue Jun 17, 2008 1:21 pm
by Lux
Hey,
that is fast response.
garvinhicking wrote:You can increase the php.ini setting "memory_limit" to get rid of that. Remember to restart apache if you change it to be sure that it gets applied.
Ok. Thanks for that.
garvinhicking wrote:S9y offers a way to track referenced images. But you would need to have used that before -- it will not work if you enable that now.
What do I have to enable for a new blog?
garvinhicking wrote:So the only way for you is to check your serendipipity_entries DB table and see which images you linked to. You could automate that with a small PHP script that matches all your <img> links and looks them up if they match in the DB...
Ok. Perfect. That is what I thought about too.
I am better in Perl, so I will write a perl script.
Is there any tool section, where I can upload it? Just to five others the chance to do the same.
Dirk
Re: Error with many pictures ...
Posted: Tue Jun 17, 2008 2:15 pm
by garvinhicking
Hi!
What do I have to enable for a new blog?
That's quite complex and too lengthy to write up here. But I've written it all up in my book....
Is there any tool section, where I can upload it? Just to five others the chance to do the same.
I'd propose to paste the script here? And I could then link to it from the FAQ section on s9y.org?
Regards,
Garvin
Re: Error with many pictures ...
Posted: Tue Jun 17, 2008 2:19 pm
by Lux
garvinhicking wrote:That's quite complex and too lengthy to write up here. But I've written it all up in my book....

Then I will find it. Just two books in between ...
garvinhicking wrote:I'd propose to paste the script here? And I could then link to it from the FAQ section on s9y.org?
Will do!
Dirk
Posted: Mon Jun 23, 2008 9:57 am
by Lux
Question: Does s9y use relative paths everytime?
Cheers
Dirk
Posted: Mon Jun 23, 2008 10:18 am
by garvinhicking
Hi!
Lux wrote:Question: Does s9y use relative paths everytime?
s9y generally does not prepend the HTTP hostname. You'll be safe if you preg_match to .*uploaddir/picture.jpg.*
Regards,
Garvin
Posted: Mon Jun 23, 2008 10:35 am
by Lux
garvinhicking wrote:s9y generally does not prepend the HTTP hostname. You'll be safe if you preg_match to .*uploaddir/picture.jpg.*

Perfect, that makes it much easier.
Will continue the script next weekend.
Thanks
Dirk