aaemnnosttv / wp-sqlite-db

A single file drop-in for using a SQLite database with WordPress. Based on the original SQLite Integration plugin.
561 stars 94 forks source link

Compatibility Issues with Serverless #60

Closed azhu021 closed 1 year ago

azhu021 commented 1 year ago

I'm trying to replace MySQL with SQLite, but I've encountered a troublesome issue and I hope to get your help.

My environment is Tencent Cloud's Serverless, which generates a temporary workspace when it runs. The absolute path for WordPress is /var/user/.

However, files and directories under this temporary workspace don't have write permissions, so mounting an additional file storage system (CFS) is required. The local path /var/user/wp-content corresponds to the remote path /mnt/wp-content.

Besides, I need to add define('WP_CONTENT_DIR', '/mnt/wp-content'); and define('DB_DIR', '/mnt/wp-content/database');. to the wp-config.php file.

My current problem is that if I want to use SQLite, I need to remove define('WP_CONTENT_DIR', '/mnt/wp-content');, otherwise, WordPress will only use MySQL. But if I remove define('WP_CONTENT_DIR', '/mnt/wp-content');, the /wp-content directory doesn't have write permissions, causing issues with uploading images, downloading plugins, and so on.

azhu021 commented 1 year ago

Issue solved. Thanks.