简体   繁体   中英

Uploading PHP dynamic website into Google Cloud Lamp Stack

I have a website in my own localhost using Wamp coded using php.

I recently joined Google Cloud Platform and have deployed Lamp Stack in it.

I also setup the MySQL database in it successfully.

But now I am confused on how to upload my files into that.

The OS is Debian 8

I have been using BitBucket for some time, is there a way that I can clone the data from there directly to google cloud?

Can anyone guide me how to upload the PHP files in there so that I can test my website?

Is there any GUI for that rather than command line? I am not that good with command line.

PS Ready to give any more relevant info, as I don't know what all data from my side is required to answer this.

When deploying google Lamp stack(click to deploy) you will automatically be creating an instance of Google Compute Engine - check Compute Engine / VM Instances menu.

Method 1:

Click on SSH button next to the instance name and a new terminal window will open. Make sure you have git installed, if not install it yourself

sudo apt-get install git

Locate your html apache/linux folder. Usually it's

cd /var/www/html

Then download your repository with

git clone https://www.path.to.repository.git

Make sure you use the https repository url not the ssh one. For SSH you will need to have the same SSH key on your instance as on your bitbucket account. With https you will be able to log on with your normal credentials.

Method 2:

You can upload files with SFTP.

First you need to generate a key with PuttyGen if you don't have one already.

Next go to the GCP menu, click on the Compute Engine menu then on the VM instances submenu.

Check the lamp instance then click Edit to go to the Edit page. Scroll down till you find the SSH keys textbox. Paste in the contents of your key.

Next use any SFTP client. You can do that from within PHP Storm, FileZilla or Putty by selecting your private key and connecting to yourusername@instance_external_ip

Good luck php wizz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM