You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Google App Engine上安装MyBB?指定路径部署PHP论坛

Deploying MyBB to Google App Engine PHP Project at /forums Path

Hey there! I’ve helped a few folks set up MyBB on GAE before, so let’s walk through getting yours deployed to https://plains.cc/forums/index.php step by step—no jargon, just actionable steps.

1. Pre-Requisites First

  • Make sure your local GAE PHP project is already set up and manageable (whether you’re using the gcloud CLI or Cloud Shell, either works)
  • Grab the latest MyBB zip package, unzip it to your local working directory
  • Double-check that your GAE project has the PHP runtime enabled (PHP 7.4+ is recommended—MyBB plays nice with newer versions)

2. Tweak Your Project Directory Structure

Since you want the forum at /forums, you’ll need to nest all MyBB files inside a forums folder in your GAE project root. Your structure should look like this:

your-gae-project-root/
├── app.yaml
├── forums/
│   ├── uploads/
│   ├── inc/
│   ├── index.php
│   └── all other MyBB files/folders...

Heads up: MyBB’s uploads and cache folders need write access, but GAE’s local filesystem is read-only. We’ll fix this later with Cloud Storage.

3. Configure app.yaml (Critical Step!)

This file tells GAE how to handle requests. Update it to route /forums traffic to your MyBB files, and set up the PHP runtime. Here’s a working example:

runtime: php74
service: default

handlers:
  # Handle PHP/HTML/TXT files in /forums
  - url: /forums/(.*\.(php|html|htm|txt))$
    script: forums/\1
  # Serve static assets (images, CSS, JS) from /forums with caching
  - url: /forums/(.*\.(gif|png|jpg|css|js|ico))$
    static_files: forums/\1
    upload: forums/(.*\.(gif|png|jpg|css|js|ico))$
    expiration: "30d"
  # If you have an existing app at the root, keep this handler; if not, you can remove it
  - url: /.*
    script: index.php

4. Fix MyBB’s Read-Write Directories

GAE doesn’t let apps write to the local filesystem, so we’ll map uploads and cache to Google Cloud Storage:

  1. Head to the Google Cloud Console and create a Cloud Storage bucket (something like plains-cc-mybb-storage works)
  2. After installing MyBB (we’ll do that next), edit forums/inc/config.php:
    • Update $config['uploadspath'] to your bucket’s upload path: gs://plains-cc-mybb-storage/uploads/
    • Set up cloud storage for caching:
      $config['cache_store'] = 'cloudstorage';
      $config['cloudstorage_bucket'] = 'plains-cc-mybb-storage';
      $config['cloudstorage_cache_path'] = 'cache/';
      
  3. Make sure your GAE service account has Storage Object Admin permissions (add this role in the IAM section of Cloud Console)

5. Run the MyBB Installation Wizard

  1. Start the local GAE dev server with gcloud app run
  2. Navigate to http://localhost:8080/forums/install/index.php and follow the wizard:
    • For the database, use Google Cloud SQL (MySQL is best) — plug in your Cloud SQL connection details (host, username, password, database name)
    • Set the Board URL to https://plains.cc/forums/
    • Create your admin account as prompted
  3. Important: After installation finishes, delete the forums/install folder immediately—this locks down your forum and prevents re-install attempts.

6. Deploy to Production

  1. Double-check all local configs work as expected
  2. Run gcloud app deploy to push your project to GAE
  3. Once deployment completes, hit https://plains.cc/forums/index.php—your MyBB forum should be live!

7. Quick Post-Deployment Tips

  • Enable MyBB’s built-in caching to pair with Cloud Storage for faster load times
  • Turn on GAE’s CDN to speed up static asset delivery
  • Set up regular backups for your Cloud SQL database and Cloud Storage bucket
  • Install MyBB’s security plugins to keep your forum safe from common threats

内容的提问来源于stack exchange,提问作者PLAINS

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:40:31