Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk9 min

How to Make Nginx, MySQL and PHP-FPM Start Automatically on Boot

A distribution-aware guide to enabling Nginx, MySQL and PHP-FPM at boot with systemd, including unit discovery, mysql versus mysqld naming, versioned PHP-FPM services and failure diagnosis.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On a Linux host that uses systemd, use systemctl enable --now for each installed service. The enable part creates the boot-time relationship; --now starts the service in the current session as well. The exact PHP-FPM and MySQL unit names depend on the distribution and package source, so discover the local names before enabling anything.

For most Debian-based systems the MySQL unit is mysql; RPM-based systems commonly use mysqld. Nginx is usually nginx, while PHP-FPM may be php-fpm or a versioned name such as php8.3-fpm. Enabling only the unit that actually exists avoids misleading “unit not found” errors.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What start, enable and enable --now actually do

sudo systemctl start example.service changes the current boot only. It launches the service now, but it does not promise that systemd will launch it after the next reboot.

sudo systemctl enable example.service creates the links or other boot-time relationships that systemd uses when entering its configured target. It normally takes effect on the next boot and does not, by itself, start a currently stopped service.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

sudo systemctl enable --now example.service performs both operations: it arranges future boot startup and starts the service immediately. This is the practical choice when you have just installed or repaired a service and want the running system and the next reboot to behave the same way.

Stopping and disabling are separate actions. systemctl stop affects the current session; systemctl disable removes the boot relationship. To stop a service now and prevent it from returning at boot, use both operations deliberately rather than assuming one implies the other.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before changing anything, identify the units on this host

Do not assume that a tutorial’s unit name matches your installation. Distribution packages, vendor repositories and versioned PHP packages can install different names or aliases.

Check that the programs are installed

nginx -v
php-fpm -v
mysql --version

Some distributions place PHP-FPM under a versioned binary name. If php-fpm -v is not found, use the PHP-FPM executable supplied by that package, or proceed directly to unit discovery.

List candidate service units

systemctl list-unit-files | grep -E 'nginx|php.*fpm|mysql|mysqld'

This lists installed unit files and their enablement state. A unit shown as enabled is already configured for boot; disabled exists but is not configured for boot; masked has been deliberately blocked from starting. The command may also show aliases, so confirm the real unit with systemctl status.

Ask systemd for the authoritative local name

sudo systemctl status nginx php-fpm mysql mysqld

It is normal for some names in this command to return “Unit … could not be found.” That output means the name is not installed on this host, not that the corresponding software is necessarily absent. The status output for a unit that does exist shows its loaded name, active state and the first useful failure message.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common names by distribution and package family

Component Debian or Ubuntu packages RHEL, Fedora or other RPM packages What to do
Nginx nginx.service nginx.service Usually use nginx, then verify with systemctl status nginx.
PHP-FPM Often versioned, such as php8.2-fpm.service or php8.3-fpm.service Commonly php-fpm.service Enable the exact unit returned by list-unit-files; do not substitute a version that is not installed.
MySQL server Commonly mysql.service Commonly mysqld.service Run the command for the unit that exists, not both commands.

Oracle’s MySQL 8.0 documentation identifies mysqld.service for RPM platforms and mysql.service for Debian platforms. Nginx’s package documentation likewise separates Debian, Ubuntu, RHEL derivatives, SUSE, Alpine and Amazon Linux procedures. Package origin therefore matters as much as the distribution label.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Ubuntu’s Nginx default

Ubuntu documentation states that Nginx is enabled to start at boot by default. If an administrator previously disabled it, sudo systemctl enable nginx restores that relationship. The setting can still be verified locally with systemctl is-enabled nginx; never rely on the installation default after a system has been modified.

Red Hat’s documented pair

Red Hat’s procedure uses nginx and php-fpm. On those systems, the configuration locations commonly involved are /etc/nginx/nginx.conf, /etc/nginx/conf.d/php-fpm.conf, /etc/php-fpm.conf and /etc/php-fpm.d/www.conf. A different PHP stream or repository can still provide a versioned unit, so check the installed files first.

Step-by-step: enable all three services

1. Inspect status and enablement

sudo systemctl status nginx php-fpm mysql mysqld
systemctl is-enabled nginx php-fpm mysql mysqld

Use the names that exist. If the output identifies a versioned PHP-FPM unit, substitute that exact name in every later command. Likewise, choose either mysql or mysqld according to the local installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Remove a mask only when you intend to run the service

A masked unit cannot be started or enabled until the mask is removed. If status or is-enabled reports masked, unmask the relevant unit:

sudo systemctl unmask nginx php-fpm mysql mysqld

Again, apply this only to names that exist. A mask may be an intentional administrative control; confirm that enabling the service is appropriate before removing it.

3. Enable and start Nginx

sudo systemctl enable --now nginx

This creates Nginx’s boot relationship and starts the web server immediately. If it fails, stop here and inspect the failure before moving on:

sudo systemctl status nginx
sudo journalctl -u nginx -b

4. Enable and start PHP-FPM

On a host whose unit is named php-fpm, run:

sudo systemctl enable --now php-fpm

For a versioned Debian or Ubuntu unit, use that name instead, for example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
sudo systemctl enable --now php8.3-fpm

The example is illustrative: use the version actually returned by unit discovery. Check the service independently:

sudo systemctl status php-fpm
sudo journalctl -u php-fpm -b

If your unit is versioned, replace php-fpm in both commands with the versioned name.

5. Enable and start the installed MySQL unit

On Debian-based systems where mysql.service exists:

sudo systemctl enable --now mysql

On RPM-based systems where mysqld.service exists:

sudo systemctl enable --now mysqld

Do not run both merely because both names appear in a generic tutorial. The correct command is the one for the installed unit. Verify it with the same name:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl status mysql
sudo journalctl -u mysql -b

or:

sudo systemctl status mysqld
sudo journalctl -u mysqld -b

6. Confirm the resulting state

Run the checks with the exact local unit names:

systemctl is-enabled nginx php-fpm mysql mysqld
systemctl --failed
sudo systemctl status nginx php-fpm mysql mysqld

Successful enablement normally reports enabled. A service can be enabled yet currently inactive if it failed during startup, so read the active state and recent log lines as well. systemctl --failed provides a quick view of units that systemd considers failed.

Verify behavior across an actual reboot

Enablement is a boot configuration, not a guarantee that a broken service will become healthy. Once each service is active and its configuration is valid, reboot during an appropriate maintenance window:

sudo reboot

After reconnecting, check all three states again:

systemctl is-enabled nginx php-fpm mysql mysqld
sudo systemctl status nginx php-fpm mysql mysqld
systemctl --failed

If the units are enabled and active after the reboot, the boot requirement is met. If a service is enabled but failed, use its boot-specific journal:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
sudo journalctl -u nginx -b
sudo journalctl -u php-fpm -b
sudo journalctl -u mysql -b

Use mysqld instead of mysql where that is the installed unit. The -b filter restricts the journal to the current boot, making it easier to distinguish a boot failure from an older incident.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When services start manually but not after reboot

Check whether the unit is enabled in the intended boot target

First confirm the state:

systemctl is-enabled <unit>

Then inspect the relationships systemd will use:

systemctl list-dependencies <unit>

Replace <unit> with the real name, such as nginx or php8.3-fpm. A service may be started manually while its enablement was never created, or it may be enabled for a target that is not used by the machine’s normal boot path. The dependency listing helps reveal whether the expected target and prerequisites are present.

Reload systemd after changing a unit or drop-in

If you edited a unit file or added a drop-in override, systemd may still have the previous definition in memory. Reload the manager before testing:

sudo systemctl daemon-reload

Then restart or enable the affected unit and inspect its status. A daemon reload reads changed unit definitions; it does not itself start or restart services.

Separate “not enabled” from “failed”

  • Disabled: the unit exists but has no boot relationship. Run sudo systemctl enable --now <unit> if it should run at boot and now.
  • Masked: systemd is instructed not to start it. Confirm the policy, then run sudo systemctl unmask <unit> before enabling.
  • Enabled but failed: boot wiring exists, but startup returned an error. Read sudo systemctl status <unit> and sudo journalctl -u <unit> -b; fixing the reported configuration or dependency problem comes before re-enabling.
  • Unit not found: the name is wrong for this installation, the package is absent, or a vendor package uses a different unit. Re-run unit discovery instead of creating a guessed service name.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure branches and precise remedies

“Unit php-fpm.service could not be found”

On Debian and Ubuntu, PHP-FPM is frequently versioned. Search for the installed unit:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
systemctl list-unit-files | grep -E 'php.*fpm'

Enable the returned versioned name, then use that same name for status, is-enabled and journalctl. Installing a second PHP version merely to match a command is unnecessary and can create an unwanted runtime choice.

“Unit mysql.service could not be found”

Try the discovery command for both spellings:

systemctl list-unit-files | grep -E 'mysql|mysqld'

If mysqld.service is listed, use sudo systemctl enable --now mysqld. If mysql.service is listed, use the mysql form. The unit name follows the package, not a universal MySQL rule.

The unit is masked

Confirm the mask with:

systemctl is-enabled <unit>

If the service is supposed to run, remove the mask and then enable it:

sudo systemctl unmask <unit>
sudo systemctl enable --now <unit>

If the mask was intentional, leave it in place. A successful command is not a reason to override an administrator’s policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nginx or PHP-FPM fails immediately

Read the service’s status and current-boot journal before trying repeated restarts:

sudo systemctl status nginx
sudo journalctl -u nginx -b
sudo systemctl status <php-fpm-unit>
sudo journalctl -u <php-fpm-unit> -b

On RHEL-family installations, inspect the documented Nginx and PHP-FPM files when the log points to configuration: /etc/nginx/nginx.conf, /etc/nginx/conf.d/php-fpm.conf, /etc/php-fpm.conf and /etc/php-fpm.d/www.conf. Correct the reported setting, run sudo systemctl daemon-reload only if a unit or drop-in changed, and then retry the affected service.

MySQL fails while Nginx and PHP-FPM are healthy

Inspect the correct MySQL unit’s status and journal rather than the other spelling. For Debian naming:

sudo systemctl status mysql
sudo journalctl -u mysql -b

For RPM naming:

sudo systemctl status mysqld
sudo journalctl -u mysqld -b

The first failure message in the journal is more useful than repeatedly issuing start. Resolve the stated error, then use systemctl restart or enable --now as appropriate.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Everything starts by hand but boot ordering is wrong

Inspect dependencies for the affected unit:

systemctl list-dependencies <unit>

Check enablement and the current-boot journal together. This distinguishes a missing boot relationship from a service that is enabled but racing a prerequisite. Do not assume Nginx, PHP-FPM and MySQL share one universal ordering; their package unit files and drop-ins define the relationships on that host.

Package source and configuration differences matter

A distribution repository, a vendor repository and a manually installed package can provide different unit names, aliases, configuration paths and defaults. Nginx’s own package guidance separates procedures by operating-system family for this reason. A command copied from an RPM guide may be correct on a RHEL-derived host and wrong on Ubuntu; a PHP versioned unit may be normal on Debian even though RHEL documentation uses php-fpm.

Keep the unit name consistent within every operation: discovery, enablement, status, logs, dependency inspection and post-reboot verification. Mixing mysql and mysqld, or a generic and versioned PHP-FPM name, can make a healthy service appear absent.

A compact operational checklist

  1. Confirm the software is installed with the relevant version commands.
  2. Discover units with systemctl list-unit-files | grep -E 'nginx|php.*fpm|mysql|mysqld'.
  3. Use systemctl status to confirm the authoritative local names and read any failure reason.
  4. Unmask a unit only when policy allows it.
  5. Run sudo systemctl enable --now nginx.
  6. Run sudo systemctl enable --now for the exact PHP-FPM unit.
  7. Run the same command for either mysql or mysqld, never by assumption.
  8. Check systemctl is-enabled, systemctl --failed and systemctl status.
  9. If a unit file or drop-in changed, run sudo systemctl daemon-reload.
  10. Reboot in a maintenance window and repeat the status and failure checks.

The durable rule is simple: start is for now, enable is for the next boot, and enable --now is for both. Unit discovery is what makes that rule safe across Debian, Ubuntu, RHEL and other systemd-based installations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.