I have a script that sends rather large MP3 files to an another server WordPress’s install via XML-RPC (using this library) from php-cli. I rapidly hit the “allowed memory size” error PHP side, which is unfortunate.
At this point, here is what I know I could do:
Set memory limit to a higher number via init_set() : problem is, I can’t really know for sure the maximum size of the MP3 files that are being recorded and sent to WP;
Set memory limit to -1 so it’s unlimited: I read pretty much everywhere over stackoverflow that I’d make a George Oscar Bluth Jr of myself, so I guess I’ll leave that option out;
So I’m left with that I see as my last resort:
It seems it’s possible to read a file line by line (honestly don’t know much about that) so it helps memory wise. How could I acheive this? Would it be compatible with IXR_Base64 to send via XML-RPC? If not, is there any other solution I could turn myself to?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
Reading by line would require quite a bit of rewriting of your code most likely. If you are still encountering problems I would recommend you ensure that your post_max_size and upload_max_filesize variables in your /etc/php5/apache2/php.ini (on Ubuntu/apache) are set to a value large enough to support the files.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.