0

I'm using CentOS 7 and I migrated website from php4 to php5 and I have in configuration file of Apache this between virtualhost:

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
AddDefaultCharset UTF--8

php_value session.gc_probability 1
php_value session.use_trans_sid 1
php_value PWD

and I'm getting the following error:

Jun 08 09:57:55 PHABCVAPACHE systemd[1]: Starting The Apache HTTP Server...
Jun 08 09:57:55 PHABCVAPACHE httpd[1401]: AH00526: Syntax error on line 24 of /etc/httpd/sites-enabled/example.com.conf:
Jun 08 09:57:55 PHABCVAPACHE httpd[1401]: php_value takes two arguments, PHP Value Modifier
Jun 08 09:57:55 PHABCVAPACHE systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 08 09:57:55 PHABCVAPACHE kill[1402]: kill: cannot find process ""
Jun 08 09:57:55 PHABCVAPACHE systemd[1]: httpd.service: control process exited, code=exited status=1
Jun 08 09:57:55 PHABCVAPACHE systemd[1]: Failed to start The Apache HTTP Server.
Jun 08 09:57:55 PHABCVAPACHE systemd[1]: Unit httpd.service entered failed state.
Jun 08 09:57:55 PHABCVAPACHE systemd[1]: httpd.service failed.

The problem is with php_value PWD, unfortunately I don't know for what I can to change it to get apache working properly. If I will comment it, apache is running but login form doesn't work.

Could someone to help me, please?

  • 1
    do not hesitate to edit and add information like your php.conf apache.con and vhost file. could you also put output of command apache2ctl configtest – Kiwy Jun 8 '17 at 10:18
0

These two lines say it all:

Jun 08 09:57:55 PHABCVAPACHE httpd[1401]: AH00526: Syntax error on line 24 of /etc/httpd/sites-enabled/example.com.conf:
Jun 08 09:57:55 PHABCVAPACHE httpd[1401]: php_value takes two arguments, PHP Value Modifier

In line 24 of your example.com.conf, Apache is expecting two args for php_value. Now if the config you provided is example.com.conf, this is something you need to fix in that config file.

0

You need to delete line

php_value PWD

because there isn't that directive in apache, and then secure your webserver in diferent way.

I don't know what you need, but you think you want to use basic auth. To do that you need to change directory section in .conf file this way:

    AuthType Basic
    AuthName "Restricted Content"
    AuthUserFile /etc/apache2/.htpasswd
    Require valid-user

and generate .htpassword file with

sudo htpasswd -c /etc/apache2/.htpasswd username

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.