Internal Server Error 500 - installing a script on php 7

Dear Friends,

I am trying to install a script on my hestiacp but it’s giving internal server error 500, I am getting error logs as below:

[Mon Dec 25 00:57:35.925624 2023] [proxy_fcgi:error] [pid 2877598:tid 281472896332160] [client 10.0.0.132:52438] AH01071: Got error 'Primary script unknown', referer: https://xxxxxxx.com/wp-login.php
[Mon Dec 25 14:26:11.079306 2023] [proxy_fcgi:error] [pid 3008631:tid 281473248629120] [client 10.0.0.132:55920] AH01071: Got error 'Primary script unknown', referer: http://www.xxxxxxx.com/wp-login.php
[Tue Dec 26 20:28:35.129655 2023] [core:alert] [pid 3225812:tid 281473263628672] [client 10.0.0.132:58940] /home/khaiser/web/xxxxxxx.com/public_html/admin/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Tue Dec 26 20:39:44.168378 2023] [core:alert] [pid 3225812:tid 281472887939456] [client 10.0.0.132:45176] /home/khaiser/web/xxxxxxx.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Tue Dec 26 20:39:44.615106 2023] [core:alert] [pid 3225812:tid 281472544002432] [client 10.0.0.132:45180] /home/khaiser/web/xxxxxxx.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: https://www.xxxxxxx.com/
[Tue Dec 26 20:40:05.999327 2023] [core:alert] [pid 3225812:tid 281472535609728] [client 10.0.0.132:51688] /home/khaiser/web/xxxxxxx.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Tue Dec 26 20:41:11.193632 2023] [core:alert] [pid 3225812:tid 281473263628672] [client 10.0.0.132:57358] /home/khaiser/web/xxxxxxx.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Tue Dec 26 20:41:11.513679 2023] [core:alert] [pid 3225811:tid 281473263628672] [client 10.0.0.132:57366] /home/khaiser/web/xxxxxxx.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: https://www.xxxxxxx.com/
[Tue Dec 26 20:46:15.075873 2023] [core:alert] [pid 3225812:tid 281472996979072] [client 10.0.0.132:52606] /home/khaiser/web/xxxxxxx.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

Please help, I am a novice but can do anything if guided with step-by-step instructions.

Warm regards,

@sahsanu bro, please check this problem and help me if you can… :pray:

Hi @khaiser,

1.- Show the output of (replace HereYourDomain with your actual domain):

v-list-web-domain khaiser HereYourDomain json

2.- You should remove php_value directives from .htaccess files and put them in .user.ini file.

root@hcp:~# v-list-web-domain khaiser xxxxxxx.com json
{
“xxxxxxx.com”: {
“IP”: “10.0.0.132”,
“IP6”: “”,
“DOCUMENT_ROOT”: “/home/khaiser/web/xxxxxxx.com/public_html/”,
“U_DISK”: “3”,
“U_BANDWIDTH”: “0”,
“TPL”: “default”,
“ALIAS”: “www.xxxxxxx.com”,
“STATS”: “awstats”,
“STATS_USER”: “khaiser”,
“SSL”: “yes”,
“SSL_FORCE”: “no”,
“SSL_HSTS”: “yes”,
“SSL_HOME”: “same”,
“LETSENCRYPT”: “no”,
“FTP_USER”: “”,
“FTP_PATH”: “”,
“AUTH_USER”: “”,
“BACKEND”: “PHP-7_0”,
“PROXY”: “default”,
“PROXY_EXT”: “css,htm,html,js,json,xml,apng,avif,bmp,cur,gif,ico,jfif,jp g,jpeg,pjp,pjpeg,png,svg,tif,tiff,webp,aac,caf,flac,m4a,midi,mp3,ogg,opus,wav,3g p,av1,avi,m4v,mkv,mov,mpg,mpeg,mp4,mp4v,webm,otf,ttf,woff,woff2,doc,docx,odf,odp ,ods,odt,pdf,ppt,pptx,rtf,txt,xls,xlsx,7z,bz2,gz,rar,tar,tgz,zip,apk,appx,bin,dm g,exe,img,iso,jar,msi,webmanifest”,
“FASTCGI_CACHE”: “no”,
“FASTCGI_DURATION”: “0s”,
“REDIRECT”: “www.xxxxxxx.com”,
“REDIRECT_CODE”: “301”,
“CUSTOM_DOCROOT”: “”,
“SUSPENDED”: “no”,
“TIME”: “19:43:47”,
“DATE”: “2023-11-30”
}
}

Also the phpmyadmin is giving this error

Where can I find the ‘.user.ini’ file on hestiacp? is it php.ini? Please reply so, I change it accordingly. I can see the .htaccess file in the script files but don’t see .user.ini there.

I changed the default PHP version to 8.2 and it worked, now this error is not showing up. I can log in to the phpmyadmin without any problem.

It is a special file that php-fpm will read and will load the directives specified in this file. When Apache uses the mod php, you can use those directives in .htaccess files but as Hestia uses php-fpm, you can’t add them to .htaccess because Apache doesn’t know about them.

So, you must create the file .user.ini in your public_html dir.

Show me the content of your .htaccess file.

This is the content of .htaccess file:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On




# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
RewriteRule ^([^/]+)/$ http://hifiscripts.com/demo/realestate/front/hifireal-admin/$1 [R=301,L]


RewriteRule ^(ae)($|/) - [L]

php_value upload_max_filesize "200M"
php_value post_max_size "200M"

Remove both lines from .htaccess file, create a new .user.ini file in public_html dir and add these lines to it:

upload_max_filesize = 200M
post_max_size = 200M

When you shown the errors, there was another php_value inside this file:

admin/.htaccess

Please do this quickly and everything will be fixed.
Here is a video I made on this error: link redacted.

Btw I hope Hestia promotes this video

The video shows how to change wordpress’s password so I don’t know how it could help here.

3 Likes

Thanks bro, it fixed…

1 Like