Primary script unknown error when trying to call a php webpage

Locked
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Primary script unknown error when trying to call a php webpage

Post 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?
Last edited by lmarcos on Tue 28. Jan 2020, 15:02, edited 1 time in total.
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

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

Post 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.
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

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

Post by lmarcos »

It's returning the same file not found and the same error log.

/home/users/user/www/domain

Folder permits are 755.
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

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

Post by lmarcos »

And php version is 7.2.24-0ubuntu0.18.04.2
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

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

Post by Florian »

Check the owner and group of the folders and files
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

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

Post 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.
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

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

Post 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.
Last edited by lmarcos on Tue 28. Jan 2020, 14:52, edited 1 time in total.
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

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

Post 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).
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

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

Post 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
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

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

Post 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.
User avatar
Florian
Keyweb AG
Posts: 1243
Joined: Wed 20. Jan 2016, 02:28

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

Post 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.
Mit freundlichen Grüßen / Best regards
Florian Cheno

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

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

Post 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.
User avatar
Szektor
Posts: 10
Joined: Mon 17. May 2021, 23:35
Location: Budapest
Contact:

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

Post 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 .
Locked