DEV Community

Allan N Jeremy
Allan N Jeremy

Posted on

Need help/tips on hosting a codeigniter application on google cloud platform

As the title suggests, I need help & tips on hosting a CodeIgniter application on Google Cloud Platform. Using app engine and PHP 7.

Current pain points

  • Unable to connect to the database

  • Handling file uploads (to cloud storage I suppose, but from within the Codeigniter app)

  • Accessing assets ~ currently using base_url('path/to/asset') and this is not working. The app deploys successfully but I cannot access my CSS/JS

  • Where do static assets go?

Folder structure

  - public
    - assets
     - css
     - js
    - uploads (uploads go here)
     - images
     - thumbnails

  - ci
    - application
    - system
Enter fullscreen mode Exit fullscreen mode

Hopefully this helps.

Another pain point

What is the host name for the database to be used in PHP?

Top comments (5)

david_j_eddy profile image
David J Eddy

@allanjeremy DM me. I don't know GCP but I can help you troubleshoot the issue. All systems are the same: request, connectivity, authorization, processing, response. We can work through then on your app.

allanjeremy profile image
Allan N Jeremy • Edited

Hello David, thanks a lot. Can't DM you on here if we don't both follow each other here (followed you). Do let me know how we can proceed with this.


david_j_eddy profile image
David J Eddy

Following :)

Thread Thread
allanjeremy profile image
Allan N Jeremy


azazqadir profile image
Muhammad Azaz Qadir

A simplest method to host Codeigniter or any other php based apps on google cloud platform is by using a php mysql web hosting platform that automates the process. Or you can use server provisioning tools, like Ansible.