Page 1 of 1

Primary script unknown error when trying to call a php webpage

Posted: Tue 28. Jan 2020, 12:57
by lmarcos
Hi again,

I'm trying to install Dolibarr and Prestashop, the first one in a subdomain created through KH panel and the second one in the domain, but everytime I enter the index.php file url for the installation script I get 'File not found' and the following error on the log.

[proxy_fcgi:error] [pid 8491:tid 139727373702912] [client XXXXXXXXX:37334] AH01071: Got error 'Primary script unknown\n'

The databases are set to local only, Apache settings are the default ones, php 7.2 is supposed to be supported by both programs, I've created cgi-bin folders in both directories, installed the required php packages, enabled fpm, reloaded apache and restarted the servers.

Am I missing some config option on the Keyhelp control panel?

Re: Primary script unknown when trying to call a php webpage

Posted: Tue 28. Jan 2020, 14:20
by Florian
Hallo,


are the folders and file rights correct?

Put a simply php file with phpinfo(); into the webfolder to see if PHP works.

Re: Primary script unknown when trying to call a php webpage

Posted: Tue 28. Jan 2020, 14:27
by lmarcos
It's returning the same file not found and the same error log.

/home/users/user/www/domain

Folder permits are 755.

Re: Primary script unknown when trying to call a php webpage

Posted: Tue 28. Jan 2020, 14:30
by lmarcos
And php version is 7.2.24-0ubuntu0.18.04.2

Re: Primary script unknown when trying to call a php webpage

Posted: Tue 28. Jan 2020, 14:38
by Florian
Check the owner and group of the folders and files

Re: Primary script unknown when trying to call a php webpage

Posted: Tue 28. Jan 2020, 14:40
by Florian
I've created cgi-bin folders in both directories, installed the required php packages, enabled fpm, reloaded apache and restarted the servers.
What does this mean in detail? It is normally not necessary when running Keyhelp.

Re: Primary script unknown when trying to call a php webpage

Posted: Tue 28. Jan 2020, 14:46
by lmarcos
Owner ID & Group ID 33 for the domain and one subdomain

Owner ID & Group ID 5001 for the other subdomain

Some other folders not under www have owner ID 5001 and Group ID 33

Keyhelp folder has owner ID 1001 and group ID 33, though and owner & group ID 1001 for the www folder.

Re: Primary script unknown when trying to call a php webpage

Posted: Tue 28. Jan 2020, 14:50
by lmarcos
Florian wrote: Tue 28. Jan 2020, 14:40
I've created cgi-bin folders in both directories, installed the required php packages, enabled fpm, reloaded apache and restarted the servers.
What does this mean in detail? It is normally not necessary when running Keyhelp.
This means that I thought that maybe some needed packages were missing and that was the reason php wasn't working for those applications because it's working on Keyhelp (you've made a great control panel here, by the way).

Re: Primary script unknown error when trying to call a php webpage

Posted: Tue 28. Jan 2020, 16:01
by Florian
Hello,

www folder should belong to the Keyhelp User as user and www-data as group and has 750 rights

Subfolders should belong to the Keyhelp user as user and group and have 755 rights

Files should belong to the Keyhelp user as user and group and have 644 rights, files that should be executed need 755 rights

Re: Primary script unknown error when trying to call a php webpage

Posted: Tue 28. Jan 2020, 16:45
by lmarcos
Florian wrote: Tue 28. Jan 2020, 16:01 Hello,

www folder should belong to the Keyhelp User as user and www-data as group and has 750 rights

Subfolders should belong to the Keyhelp user as user and group and have 755 rights

Files should belong to the Keyhelp user as user and group and have 644 rights, files that should be executed need 755 rights
That solved it, thank you very much, Florian.

One other question, I'm getting the following message with PrestaShop installation needs to write critical files in the folder var/cache. Please review the permissions on your server.

I don't want to mess anything.

Re: Primary script unknown error when trying to call a php webpage

Posted: Tue 28. Jan 2020, 17:21
by Florian
Hallo,

check the permission of the folders var/cache inside your prestashop directory if it has got the correct permissions.
Do not set 777! Since PHP is running under the user ID of the Keyhelp user it can create files inside the folder if the folder belongs to the Keyhelp user.

Re: Primary script unknown error when trying to call a php webpage

Posted: Tue 28. Jan 2020, 17:46
by lmarcos
It must be something else, because I set permissions to 755 on five other folders and it's still telling me Permissions on files and folders
Recursive write permissions for Apache user on ~/img/

PS Edited. Those folders were not missing permission, but owners. Just in case it helps others in the future.

So, once again, thank you very much and have a very nice day, Florian.

Re: Primary script unknown error when trying to call a php webpage

Posted: Fri 25. Jun 2021, 03:51
by Szektor
So if I am correct this is good changing myuser with the needed KeyHelp username:

Code: Select all

cd /home/users/myuser/
sudo chmod 750 www
sudo chmod myuser:www-data www
cd www
sudo chown -R myuser:myuser .
sudo chmod -R 644 .
sudo chmod -R +X .