• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue Issue linking second database to subdirectory app on same domain

immc

New Pleskian
Server operating system version
Plesk Obsidian
Plesk version and microupdate number
18.0.72 Update #3
Is there some 'trick' in Plesk to installing an app to a subdirectory of an existing website and linking that app to another database on that same domain?

Bare with me:
- The existing website is already pointed to its database in the Domains > Databases list.
- A new database has been created that points to this same domain and it shows 'Assign this database to a website.'.
- The app files for this script have been uploaded to https://mydomain.net/appfiles.
- Per the instructions to install the app I go to https://mydomain.net/appfiles/admin.php.
- After installation when attempting to access the website I get the following error:

This page isn’t working
mydomain.net is currently unable to handle this request.
HTTP ERROR 500

Per the Error log:


AH01071: Got error 'PHP message: PHP Fatal error: Uncaught mysqli_sql_exception: Table 'my_appfilesdbs.sb_settings' doesn't exist in /var/www/vhosts/mydomain.net/httpdocs/appfiles/include/functions.php:143\nStack trace:\n#0

Requirements:
- Folder permissions: 755.
== httpdocs$ find appfiles -type d -exec chmod 755 {} \;
- File permissions: 644
== httpdocs$ find appfiles -type f -exec chmod 644 {} \;

Verifying other requirements. Also awaitng support from app developer.
What else could I be overlooking? Any responses appreciated.
 
Honestly the whole thing about the domains pointing to a database has nothing to do with the application itself, you can easily have the database not assigned to any domains and you can still use the database. The whole point of assigning a domain to a database is more so for you to know what that database is belongs to so you know if the database is in use or not.

As for the issue you're having, you would need to check your PHP configurations and/or database tables and settings because it's stating that a table does not exist (the my_appfilesdbs.sb_settings table). Make sure you're using the proper information for connecting to the correct database (assuming you're using the database that comes standard with plesk, it's best to use localhost as the connection, just make sure the name, the database name, the username for said database, and the password for the user of said database is all correctly set in the PHP file that handles the database connection).
 
Reply:
- The first subdirectory app installation of mine so this good to know in regards to creating additional databases on the same domain.
- Config file info confirmed to posses the same connection info to include specifying localhost during the installation.
- Adding /appfiles/admin.php?debug is supposed to aid in troubleshooting but it returns the same 500 error.
- Most requirements have been met, still checking.

Thanks for the reply!
 
I don't know what kind of PHP site you're using but usually the debug is only useful if it's not a database issue (like an issue with how you called a variable or something).

The error clearly states that it's a table that's missing so either you are not using the proper database connection information in the PHP file that contains the database connection or you're missing the a prefix or maybe missing a step to import/install the required tables into the database.

Again, this is not a PHP issue, either wrong database connection info or missing the prepopulated database items.
 
Per app developer:

Debug mode

Enable debug mode if you have issues with Support Board or you are customizing it. To enable debug mode, add the debug attribute to the URL of the admin area. E.g. https://www.your-site.com/supportboard/admin.php?debug.

Also from the app dev:

403 Forbidden Error

The 403 Forbidden error is strictly a server-side issue related to file permissions or a firewall rule that blocks access to the resource. We can not help with it because it is not related to our product. Please send this message and the URL of the blocked resource to your server support, and they will solve the issue. Below you will find the most common causes of the 403 Forbidden error.

- File permissions — The file permissions of the resource are not correct. The file permissions should be 644 for files and 755 for folders. (Confirmed)
- Firewall — The firewall of your server is blocking the resource. You can check it by disabling the firewall or by using a VPN.

- ModSecurity — The ModSecurity of your server is blocking the resource. You can check it by disabling the ModSecurity or by using a VPN.

When it's related to ModSecurity I usually get a 6-digit code in the error log that I can add to Security rule IDs to resolve that issue but that's not the case in this scenario.

PHP Debugging Enabled and these are the errors now displayed on the website:

Fatal error: Uncaught mysqli_sql_exception: Table 'tappfilesdbs.sb_settings' doesn't exist in /var/www/vhosts/mydomain.net/httpdocs/appfiles/include/functions.php on line 143

mysqli_sql_exception: Table 'appfilesdbs.sb_settings' doesn't exist in /var/www/vhosts/mydomain.net/httpdocs/appfiles/include/functions.php on line 143


Waiting for response from the app developer to the sql related errors.
 
Back
Top