243 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
creativestuff says

Hi actually I am making a temporized newsletter system (so I have the DB set up to save all the data needed like the message emails and so on)

I have a cronjob (cron.php) which is called every minute, this cronjob (actually) accesses the DB get out the active sessions , creates the email and sends the email with phpmailer (5 every minute to be sure the server won’t get blacklisted) working fine…

..until I decide to use more SMTPs (having 30) to have 150 emails sent / minute (each smtp gets 5 mails)

since there are 150 calls for sending mails + DB accessing + script run-time I might get out of allowed php execution time so I decide to brake down the mail sending part into another file (mail.php which will be called by cron.php) so from the actual: 1 process sending 150 emails – I want to get to 30 processes make 5 emails each

I was thinking to call mail.php with cURL… but each cURL waits for its response (I search for silent cURL but haven’t found anything useful)

Solutions would be:

a) having 30 cronjobs + 30 php files… I don’t like it since I don’t wanna add cronjobs each time another smtp has to be added

b) php Sockets – send 30 socket message without w8ing for the response.. (I don’t know if it would make a different process)..

ANY IDEA ?!?

22 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
r0ash says

set_time_limit(0); will make sure, your script dont get time out.

However if you are running your scripts via cron, I dont see why they will get timeout.

243 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
creativestuff says

well yeah… but what if the server rules limit the execution time to the default 30S… I would like a solution for the more distinct processes (it might be useful at other projects)

...in other words how can a php script execute (without the EXEC function cuz that’s vulnerable and usually disabled on the hosting servers) another php script without requesting any feedback from it…

...like when the bully kicks the little boy on the tricycle down from the hill … he know that the little boy will brake his everything… but he goes away cuz he don’t care when and how… :D

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says
243 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
creativestuff says

thx dtbaker this should do the trick (almost forgot about fork… it’s been a long time I last used it)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by