newvoids
By:
newvoids

Can someone help me host this php file?

December 31, 2016 524 views
DigitalOcean Apache Ubuntu 16.04

Hello DigitalOcean community,
I've been trying to host my php file on DigitalOcean, but I can't figure out how. I've created a droplet and tried many things but still cannot find out how to upload the php file to the host. For now, I don't need a domain. The IP is fine. If anyone could help me I would be very thankful. If you wouldn't mind helping, you can add me on Discord or Skype (or if you have another program you want to contact me on I can use that aswell).

Thank you so much!

3 Answers

Hi, @newvoids - Have you install LAMP or something like this in your server. Also, Can you tell the exact file path, Where you uploaded your php file.

Thanks

  • Thanks for your response @RactSolutions. Right now, the PHP file I'm trying to upload is on my localhost. On my computer, it's in "C:\xampp\htdocs\test\testphp.php". I've also heard xampp is bad so I'll install LAMP right now.

  • @RactSolutions Alright, after some technical difficulties I finally installed WAMP and fixed my PHP code to work with it. How would I put it online? I'm still stuck, lol.

I see you are new at this then. If you want to run and manage the server your self (thats what Digital Ocean is, you must manage the server yourself) then install a web admin like VESTACP that will set everything up so you can login and setup your site on a web based GUI.

@newvoids

WAMP is a valid solution when you're working locally, though when you're working remotely, as would be the case when you connect to your Droplet, you'll need to mimic the environment you're using to develop. In the case of WAMP, you'd want to setup a LAMP configuration (Linux, Apache, MySQL, and PHP).

To do this, you need to know what packages your current setup requires and then install them on your Droplet. This can be done using a package manager, or you can compile from source. If you're not too familiar, or at all familiar with administering a web server for production, I would advise using a control panel, such as VestaCP (or a similar alternative) as it'll be far easier to setup and it'll help you to get up and running far quicker.

Both methods will have their own learning curve, though using a control panel will simplify much of what needs to be done from the command line if you were to choose to install using packages or from source.

At the end of the day, however, you do need to know how to secure your server as using a Control Panel is not a free pass or golden ticket when it comes to security. Even commercial products, such as cPanel and Plesk perform very poorly when it comes to security as they don't really provide a means to properly secure and lock down your server.

You can read the guide below which will help you to setup VestaCP:

https://www.digitalocean.com/community/tutorials/how-to-install-vestacp-and-set-up-a-website-on-ubuntu-14-04

The Vesta Control Panel is a free, open source website control panel with website, email, database, and DNS functionalities built in. By the end of this tutorial we will have Vesta installed and running on Ubuntu 14.04 with a working website and email account.
Have another answer? Share your knowledge.