I want to run PHP in Apache, but the source code still appears.

Asked 2 years ago, Updated 2 years ago, 73 views

I am trying to run the PHP web application with apache on the CentOS 7 server.

Currently, the PHP is not running in apache, so when I access the target path, the PHP is not running and
The source code is still displayed.

As a new configuration file,

LoadModule phpModule modules/libphp5.so

Added .The file is symbolic but exists.

$systemctl restart httpd

Then,

Job for httpd.service failed.See'systemctl status httpd.service' and 'journalctl-xn' for details.

will be

$journalctl-axn

Then,

April 18 13:15:27 tomato.centostkg httpd[2478]:httpd:Syntax error on line 56 of/etc/httpd/conf/httpd.conf:Syntax error on line 1 of/etc/httpd/conf.modules.d/php.conf:Cannot load modules/libphp5.so invertarbouted: libgmp.so:// .://ed://snubarget://libgmp.so
 April 18 13:15:27 tomato.centostkg systemd[1]: httpd.service:main process expired, code=exited, status=1/FAILURE
 April 18 13:15:27 tomato.centostkg kill [2480]:kill:cannot find process"
 April 18 13:15:27 tomato.centostkg systemd[1]:httpd.service:control process expired, code=exited status=1
 April 18 13:15:27 tomato.centostkg systemd[1]: Failed to start The Apache HTTP Server.

It is shown that
PHP could not be installed successfully, so I rebuilt it from the source.
I was told that I should create a symbolic link for libgmp.so.10 to /usr/lib/libgmp.so.3 but it didn't work either.

php centos apache

2022-09-30 19:12

1 Answers

I don't know the direct cause, but I'll delete Apache and PHP and reinstall them from scratch. I restarted Apache and it worked well.

This post was posted as a community wiki based on @omarun's comments.


2022-09-30 19:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.