Direct deployment PHP files on OpenShift - php

Is it possible to deploy php files on Openshift directly? (That is, not via git).
Most of my php files are single page files and I'm looking for a way to SFTP directly into Openshift.
I am able to login via Filezilla, but when I try to transfer files into directories like app-deployment or app-root etc, the file gets deleted.
Openshift folder structure:
So, how can I upload PHP files directly?

After many trials, I found that its actually possible.
Inside this folder: app-roots/repo/myfile.php

OpenShift has a few blog posts on the topic:
Using FileZilla and SFTP on Windows with OpenShift
Getting started with SFTP and OpenShift (Using Netbeans)

Related

Command for downloading all website project files

I have access to server of our company's website. I access it using Putty.
I want to download all files(index.php, any jpg files for favicons, etc.) used for deployment of the web project. When I told to programmer of website to share the full script(HTML,CSS,PHP, jquery plugins), he said that I can access the entire code from server.
When I enter the server via Putty(private key+ssh), and then I type "ls" I see that there are "index.php" and "mysql" files, the full contents of which I cannot download.
What are the useful resources for list of commands?
Which command should I use to download the project folder containing all files with code and without code?
P.S. I do not know if this information is necessary, but the website was deployed using DigitalOcean.
As you are using Putty, I'll assume you are working on Windows. There is a GUI tool called WinSCP that works similar to Putty (i.e. over SSH and uses private keys and stuff) and can be used to access the remote server's filesystem. It has a pretty simple to understand UI which will be divided into you local filesystem and the server filesystem. Once you're connected and have reached the files you need you can just drag and drop the files into your local filesystem side.
If you would like to explore some command line options, its basically any tool that does scp. I think Putty comes with scp or pscp installed already. You can check by just typing in the command in your cmd/powershell.
You can download pscp.exe from PuTTY website and then:
Open cmd.exe and type:
pscp your_username_here#yourcompany.com:/path/to/file C:\Path\To\The\New File

uhttpd & PHP access files on sd card

I'm trying to make my php filemanager to be able to manage files outside the web-root. I'm using a router with OpenWRT. I have PHP5 and uhttpd (default Luci webserver) installed. The files are stored on a USB drive that's not always plugged in. The index.php is located in /www and the files are stored (when mounted) in /mnt/sda1.
I've been playing around with the permissions and user/groups with nog success.
Is there a way to do this? I don't want the filemanager itself running from the USB drive.
It seemingly isn't possible without a second webserver (different port) so I'm going to use a samba server that directs to a symlink to the /mnt/sda1 and use php to access the samba server.

How to access my website's PHP files using Windows Azure WebJobs?

I have a website hosted on Azure.
My website files are stored in wwwroot. I'm using Azure WebJobs to schedule some tasks. This WebJob is a simple PHP file. It needs to access my websites files.
For the purpose of this discussion, let's say I want to edit my index.php or images/ folder which is located in the website root.
My WebJob runs from this location: C:\DWASFiles\Sites\<sitename>\Temp\jobs\triggered\<jobname>\kjsx2sne.7sa\script.php
How can I access my website's files? Where are they located? I tried to access C:\DWASFiles\Sites\<sitename>\. However I'm getting a Permission denied error in PHP.
Any help will be highly appreciated. Thanks.
As mentioned in this stackoverflow post, the path for the root of an Azure Website is (usually) D:\home\site\wwwroot

Upload files on file server in intranet in php

I am maintaining two local servers on local network (within the office premises).
One is the server where my php files are being located and another server is a File Server where I want to store all the uploaded files.
As the second one is a file server so there should no need to install php on that server.
How I can upload the files to another server. I have the full rights to access the file server. I tried to use ftp_connect() method. But that is not working in Intranet however, it is perfectly working with any live server ftp credentials.
If I use CURL then I have to install PHP on my file server, but that is not a good practice. So how I can upload the files using php ftp related methods?
How I can upload the files to file server. Thanks in advance.
Since in your case both client and server are Unix systems, the easiest is to mount a directory of the file server on the web server by NFS. This way you can upload files by copying or moving them locally, no need to muck around with FTP or SSH modules in PHP.

php file_get_contents ('....datafile.xml') - get the datafile from my local desktop?

I have a database that exports xmls only locally (to my computer). It will not export to a remote server.
I have a php file (located on remote server) that sends the xml to a webserivce.
Can I have the remote php file use "file_get_contents" function to extract xml data from my local computer?
If so, what is the proper syntax?
Thanks in advance.
I think you should add a file upload page,upload the local xml file to remote server,the do the the next work.
You have a couple of options...
You could run a local web server on your computer and publish the files via that. Your remote PHP script could then read the file.
A potentially better alternative would be to use something like Dropbox. Save the database files in your Dropbox folder. They will be automatically uploaded to the Dropbox cloud storage.
Your remote PHP script could then retrieve them via the Dropbox API or if they are in the "public" folder, directly via URL.
You have to make your file available from your linux machine:
install a webserver on your desktop machine and allow it to expose the file, so the file will be available to an URI like http://ip_of_your_desktop/path_to_files/filename.xml (this was mentioned above also)
if your desktop and server are on the same network, share the folder on your desktop, mount the folder on your linux machine and use file_get_contens to read the file from the mounted location

Categories