Geoff
Geoff

Reputation: 46

How can I improve PHP CLI output speed

Recently discovered merits in running php scripts via cli, and while the work-flow is faster I've found that executing php scripts via cli is much slower than just refreshing the browser.

echo 'hello'; // >1 second cli vs <10 millisecond in browser

I understand php environment is required to load on every execution call (via php -f), whereas in the browser, php is already loaded into memory via the webserver.

I'm looking for a solution to speed php startup time. Apache is running.

The goal is to speed up the output via a text editors output, which by default runs php -f.

I'm hoping there is a way to either I pre-load php or pipe into apache directly maybe by using the fast-cgi stream directly, but how?

Upvotes: 1

Views: 1928

Answers (1)

andsens
andsens

Reputation: 6948

If you are running php on windows and have curl enabled you might be experiencing a bug which was reintroduced in 5.3.6, and also existed before 5.3.5. The libcurl library takes ages to load when on windows.

Upvotes: 5

Related Questions