0

I recently created a PHP server on an Amazon EC2 Linux AMI instance and I am struggling to figure out how do to upload the PHP code to in order to be displayed on the browser from a .php file type setting.

The only option that was availiable to me to write PHP code and have it displayed was through creating a script directly from the Linux Terminal using the following commands

>SamplePage.php   #this creates the php file
nano SamplePage.php   #this opens the editor to start writing the code in the terminal.

However is there a visual interface that I could use to upload php code files/documents/pictures. So that I can click and drag the .php file on to the server without typing it on the terminal?

Does the phpMyAdmin do that? Or is is only for used managing MySQL (database) tasks and not for uploading PHP files/graphs/pictures needed to develop a fully integrated site?

By the way, here are the instructions I used to create the LAMP server with PHP as well as MySQL. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

jessica
  • 1,325
  • 2
  • 21
  • 35
  • Or is there a way to upload the .php file onto the server from my desktop/laptop computer and onto the Linux EC2 server using a command? I am not sure what is the most common way used by developers to upload their .php file on their sever. – jessica Jun 15 '19 at 01:30
  • See: https://stackoverflow.com/questions/34869580/how-to-upload-local-system-files-to-amazon-ec2-using-ssh . (For more search" "upload files to amazon ec2 instance".) If you've used shared hosting before you could also set up a LightSail server using the Plesk image and run it using Pleask's free license tier. – Dave S Jun 15 '19 at 01:36
  • Possible duplicate of [How to upload local system files to Amazon EC2 using ssh?](https://stackoverflow.com/questions/34869580/how-to-upload-local-system-files-to-amazon-ec2-using-ssh) – Dave S Jun 15 '19 at 01:37
  • This is basic system administration. Use SSH which includes SCP. There are lots of IDE's and tools that will allow you to synchronize code that support doing this using SSH/SCP. – gview Jun 15 '19 at 01:37

1 Answers1

2
  • phpMyAdmin is a web-interface for managing databases.

  • You could check if there is already some ftp-server installed. Like vsfpt (just an example, there are a lot more free & open source ftp-servers available). if you encounter any problems with that a good place to ask questions related to hosting and servers is ServerFault

  • You could also transfer the files via ssh-connection with the help of scp (See: How to copy files from one machine to another using ssh or How to upload local system files to Amazon EC2 using ssh). Another option would be to use a visual ssh-client.

  • There is also server-management software available that offer a visual file-manager as a website, like plesk, but since you already setup most of the stack this would be hard to do on top of that.

  • There are many IDEs and Editors that have support for SSH and SCP. Either built in or through plugins. For example: Eclipse, Netbeans, Atom and VSCode. All of which are free and can be configured to support PHP development.

Jan
  • 2,853
  • 2
  • 21
  • 26
  • 1
    You left out IDE's or Editors that have either built in or plugin support for SSH/SCP like Eclipse, Netbeans, Atom and VSCode, all of which are free and can be configured to support PHP development. – gview Jun 15 '19 at 01:42
  • Good point. I will add that info. Thanks for mentioning that! – Jan Jun 15 '19 at 01:45
  • 1
    you also left out git : develop local with a good IDE , push-pull to/from a repo. I personally dont do any development work on my prod/staging (eg amazon). – YvesLeBorg Jun 15 '19 at 01:46
  • Yes, that's also a good option. I do it this way myself for projects. But since the question was how to be able to drag and drop transfer files to the server/hosting, i think this option is a maybe bit over complicated. – Jan Jun 15 '19 at 01:51
  • Hi Jan thank you for your response. What do you commonly use when developing websites? I have Atom installed on my computer. Are you saying there is a way to code all .php files along with the graphs/pictures and have them sent to the Linux Server using the Atom IDE using an SSH? – jessica Jun 15 '19 at 01:52
  • 1
    Yes, exactly. [Here's an atom package](https://atom.io/packages/remote-sync) for doing exactly that. – gview Jun 15 '19 at 03:01
  • 1
    I looked at this a bit more, and it seems the project I linked is abandoned. There was a fork and that one also seems to be dead. Use [remote-ftp](https://atom.io/packages/remote-ftp) instead, as it's the most active plugin of this type and has the largest install base. Configure an sftp connection (which will use ssh). Also [found a video](https://www.youtube.com/watch?v=AkXJPADbV24) from a few years back that should help you understand what it actually does and how to use it. – gview Jun 15 '19 at 04:00