Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6851247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:13:28+00:00 2026-05-27T01:13:28+00:00

When I execute my email script via browser a timeout fatal error is returned

  • 0

When I execute my email script via browser a timeout fatal error is returned (unless I drastically increase the execution time, then it will run ok, not the solution I’m looking for). The email is sent tho, but it takes forever (5 min. average) to arrive (at my inbox)!
(Considering that via command line it works perfectly I think that SMTP at php.ini is certainly well configured.)

So this is the code executed by browser request:

<?php
mail('amatos@example.com', 'test subject', 'test body', 'From: Andre Matos <amatos@example.com>');
?>

and when I run this same (is it really the same? I’m starting to doubt myself) code via command line:

php -r "mail('amatos@example.com', 'test subject', 'test body', 'From: Andre Matos <amatos@example.com>');"

it works perfectly! The script runs, it stop and the email arrives instantly (2/3 seconds).

So, what can cause this difference and how to fix it? Any ideas?
Thanks in advance.


[edit] some extra info:
– the machine is windows
– the server is localhost
– php.ini is the same for both the browser and the cli instance


[edit2]
Thank you all for trying to guess which was the problem. I placed the question hopping that someone had the problem before and knew of something specific. Given nothing specific showed up and none of the suggestions really worked, I’ve decided to accept the one that allowed me to reach more conclusions about the problem… +1 For all your helpful knowledge/thoughts (/guesses) 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:13:29+00:00Added an answer on May 27, 2026 at 1:13 am

    I’ve hypothesised some couses, but I used to linux and on windows I can olny guess:

    1. php_cli and mod_php are 2 different binaries, mod_php can be slightly damaged
    2. php_cli and mod_php use 2 different users, the network profile of apache user can be the problem (dns, firewall, proxy…)
    3. your php script is on “problematic” location or contains some problematic character, but your cli script is by param, try to execute same script: php -f z:\path\to\php\mail.php
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using this script for the email attachment but when i execute the
I am facing a strange error when I execute a php mail script. Its
When I am trying to execute following code to email the contact form details,
I execute a lot of custom actions in my InnoSetup script in the CurStepChanged(ssPostInstall)
I have Mail set up to execute an AppleScript when it receives an email
Below is my simple Sendmail script. while running, it executes without any error ..
I am trying to create a script that will only execute its actions if
Is there a way to configure a server or a script to execute a
When I initially wrote this script, the site design did not require the execution
I want to execute this sql script inside my seed.rb LOAD DATA LOCAL INFILE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.