How can i to deploy my PWA on remote server? - php

I developed a Progressive Web App (PHP and JavaScript based) and i upload it on remote server LEMP (Debian/Nginx based) through FileZilla.
How can i deploy in future the updates without to use FTP?
What tools exists for to manager the next versions of my web app?
If it is of utility i use VSCode for coding.
Thanks guys!

You can't update your web app without FTP. In order to update a new service worker, it needs to have at least one byte different than the previous version.
And the only way to update the service worker file is via FTP.
If you can't use FileZilla for whatever reason, you can try alternatives like editing files through Cpanel File Editor.

Or you can use free hosting like Github Pages, Netlify or Firebase. And automate the deployment of your front each time you commit something on a git repository.
This solution only works for your static files. not for your backend using PHP.

Thanks guys for your replies.
I found the right solution for me following this article: https://amifactory.team/blog/how-to-deploy-a-website/#simplewayscprsyncftp
In pratice i use lftp utility to sync my local website with my website on remote server.
The good notice is that "lftp" copy changed files only, reducing the uploading time and copying / overwriting the new files only at the end of the "lftp" process.

Related

Using php with angular application hosted on AWS

I'm new to AWS. I created a DB and I am currently hosting the website right now. This is great!
The problem is that I don't know how to integrate my PHP files that I was using before the start of AWS.
My previous stack was: Angular, MyPHP, MySQL, Apache. Everything was running locally. So I was able to use the same IP for the database and to also run php files.
What I tried to do was upload the php files into the S3 bucket. This doesn't work. The website will only download the file and not execute.
So how would I implement the same fluid way of integrating PHP on AWS as I did on my local computer?
If you want to do this on AWS you will need an EC2 instance to run your dynamic queries to the database. S3 will only host static files or programming which works on the client-side (JavaScript).
If it is a basic website, you might want to consider LightSail
My suggestions would be,
use EC2 instead of using s3 for hosting the PHP website as you can have complete control over the server.
For setting up EC2 with PHP please follow the steps in the following article.
Setting up EC2(ubuntu instance) for php

GCloud App needs FTP - do I need a VM or can I create an FTP app?

I'm running a PHP app on GCloud (Google App Engine). This app will require users to submit files for processing via FTP. A python cron job with process them.
Given that dev to prod is via the GAE deployment, I'm assuming there is no FTP access to the app folder structure.
How would I go about providing simple one-way FTP to my users? Can I deploy a Python project that will be a server? Or do I need to run a VM?
I've done some searching which suggests the VM option, but surely there are other options?
App Engine projects are not based on server virtual machines. App Engine is a platform as a service, not infrastructure as a service. Your code is packaged up and served on Google App Engine in a manner that can scale easily. App Engine is not a drop-in replacement for your old school web hosting, its quite a bit different.
That said, FTP is just a mechanism to move files. If your files just need to be processed by a job, you can look at providing an upload for your users where the files end up residing on Google Cloud Storage and then your cron job reads from that location and does any processing that is needed. What results from that processing might result in further considerations. Don't look at FTP being a requirement, but rather a means to moving files and you'll probably have plenty of options.

How to host Codeigniter app on Azure?

I wanted to ask you to help me (with some tutorial link or something), what i want to do is to upload php Codeigniter application on azure?
Also in my application, I got upload feature so I should make it work too (don't know if it's more complex becasue of that).
I was using wamp during developing, now I need to push it on server.
Generally, deploy a CI application to Azure Web Apps is simple, you can simply create an Azure Web Apps on Azure portal, then step in the manage page of your Azure Web Apps, click All settings=>deployment source=>chose source=>Local Git Repository to set the git deployment setting of your Azure Web Apps service.
Then you can find the Git clone url under the essential tab.
Additionally, Azure App Service can run php composer.phar install when you run git push, but it's not enabled by default. To enable it, you need to install the Composer extension for your web app.
Here is a CI template on Azure sample, you can refer to https://github.com/Azure-Samples/app-service-web-php-get-started for any hits.
And here is a video https://youtu.be/bBb_Hi2Odqc, you can refer to. It manages on the classic portal, but still works today.
Deploying Codeigniter is very easy, all you need to make sure is placing the project directory correctly.
Just upload the project folder to the hosting either by SSH or FTP.
Modify the .htaccess file accordingly.
Once all the above is set up, including uploading all the files to host, don't forget to update config.php database.php and route.php with new hosting parameters.
To make your upload feature work correctly you just need to give proper/required write access to the upload folder of the application.
And that's all you need to do while deploying Codeigniter application.

Do I need to install PHP, MySQL, and something like XAMP, if I already have an IDE, a webhost, and FTP client?

It seems like there are two ways to go, and the determining factor is whether you want to host on your own computer, or through a webhost.
If I have an IDE, a webhost server I subscribe to, and an FTP client to transfer my files to the server, then I don't need to install PHP, MySQL, and XAMP, right?
I know XAMP allows me make my computer website server.
When I install PHP, am I installing the intepreter for my computer/server to parse the .php files? (and same for MySQL?)
If I pay for web hosting, then their servers already have PHP and MySQL parsers, and all I need to do is upload my text files, right?
Thanks in advance
U just cant simply put the files in server without developing them.and if you want to develop any website or any webapp then u need to make your system a local server where you can execute your server side languages like php.XAMP is a short form for mysql,apache and php for windows.and 'website server' is not the proper word.use LOCALHOST instead because only u will have access to your server unless you are connected via LAN or WAN.so i can summarize the above in few points keeping in mind that you want to develop your website.
step 1:install XAMP
step 2:develop and test your scripts.
Step 3:if everything works fine than host your site in the webserver for everybody to see it.

PHP shell_exec doesn't work in Windows Azure

We need to execute an .exe file in a remote Windows Azure Server.
We call it from PHP with shell_exec. The .exe should create new files in two different folders into the server and generate data entries in a data base and returns a string, but it doesn’t work.
We don’t have any problem executing it in our local server with windows 7 Enterprise and IIS 7. That’s why we thought it could be a permissions problem, and then we have created a .user.ini file with the following content:
safe_mode= off
safe_mode_exec_dir= off
Unfortunately it doesn’t work too.
Any suggestions?
Thanks in advance.
You are most probably working with Windows Azure Web Sites. This is a high-density shared hosting with tightened security. If you need things like shell_exec you shall move to Windows Azure Cloud Service (Web Role), where you have full control over the OS and web server / php settings.
Using Cloud Service you will be able to use shell_exec. However when you move to Cloud Service you have begin thinking of saving files in Azure Blob Storage, as the local storage for cloud service is:
Not persistent
not synchronized across role instances
If you want don't yet know what Role and Role Instance is, or are little confused, please go through this article.

Categories