Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
On CentOS 8, php-cli is the only option?

I have a new server with CentOS 8, and I wanna have LAMP on it. In order to integrate PHP with Apache, I can remember there are two solutions: CLI and Apache module. But all howtos that I found are using php-fpm (which apparently is the CLI config with Apache).

I wanna know is there a way to config PHP as an Apache module on CentOS? If so, which package I should install using dnf?

One more thing, I can remember it was recommended to use PHP as an Apache module rather than using it as CLI. Is that still correct?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

First thing - php-cli is meant for console operation without knowledge of HTTP request, HTTP server env variables and so on. It is used for CLI tasks like scripts run by CRON.

What you need is to have mod_php package installed. Then you have to enable (and configure) it within apache configuration.

According to this article the metapackage php should already include mod_php, so it should suffice to enable it.

The module can be enabled interactively using a2enmod or by adding config directives manually, like:

LoadModule php7_module /usr/lib/apache2/modules/libphp7.3.so

The example is not from Centos, so YMMV.

over 4 years ago · Santiago Trujillo Report

0

By php-cli, you probably meant php-cgi.

php-cli is meant for running scripts from within terminal, not to be invoked from web server.

mod_php is not threadsafe if used in threaded MPM like event.

For best performance you should try FPM, which is separate pool of workers that could be invoked via socket, regardless of actual MPM used by Apache.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!