Question

how to upload php application to ubuntu LAMP droplet and connect app with mysql?

I created a preset droplet call ubuntu LAMP.

I can access to this droplet via ssh. And that’s all. I don’t know what to do with the following steps

Where in the droplet should I upload my PHP app to?

How can I config droplet’s mysql so that my app can connect to mysql?

How can I upload my data to droplet’s mysql ?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The command:

ssh root@174.138.65.31

will log you into a terminal on your server it will not upload any data. The easiest way to upload data is via the SFTP protocol as your server already supports this via the SSH server.

How you do this that depends on what OS you are running on your laptop. If you are running Windows then I recommend WinSCP:

https://winscp.net/eng/index.php

If you are using OSX then Cyberduck:

https://cyberduck.io/

And if you are running Linux locally, you can either use SCP from the command prompt or use your file manager (Files on Gnome or Dolphin on KDE) to upload the files.

This comment has been deleted

This has happened because /var/www is owned by root and you are attempting to create a new directory as a non-root user.

If you have logged into the server via SSH as a non-root user then you will need to log out and log back in again as root and follow the instructions here to create a sudo user:

https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04

If you are attempting to create the directory via an SFTP program like WinSCP then you will need to use your root account to log in.