Azure Webjobs and php.exe - php

I have a php application (ARPReach) installed on a Azure VM. I use Task Scheduler to run a .bat every 5 min that has this simple line of code:
"C:\Program Files (x86)\PHP\v5.4\php.exe" E:\Web\arp\a.php cli/auto
Now I want to move this php app to Azure Website, and I need a similar scheduling functionality as the above.
I got the path to php.exe from the Kudu site and added a Webjob (cron.bat) to my website with the following line:
"D:\Program Files (x86)\PHP\v5.4\php.exe" D:\home\site\wwwroot\a.php cli/auto
and it seems to work fine.
However I'm not sure if this is the right way to do it with Azure Webjobs / Websites. I mean are the paths going to change after restart or auto-scaling?
Can anyone confirm for me?

Restart or scaling will not change this path, it should not change unless Azure Websites will stop supporting php version 5.4 for some reason.
So this batch file should work fine, I would use %ProgramFiles% instead of D:\Program Files (x86).

Related

Url folder specified in my project to interact with files

I have a "web site project". In my project I am using the php exec to use the ubuntu package PDFTK to manipulate pdf.
For example I have this line of code(php) in my model, I am using code igniter :
shell_exec('pdftk /var/www/html/IntegrSupCours/uploads/GKAG01_FR.pdf dump_data output /var/www/html/IntegrSupCours/uploads/bookmark.txt');
Indeed Im starting from /var/www to access to my pdf file, because I am on ubuntu.
But let's say that I am on a localhost ubuntu pc and I want to migrate my site on a online server what will happend if I am changing to that, because the url string in my shell exec to access at my pdf file will be different ?
First of all the remote online server that you are mentioning is a machine with some operating system like ubuntu installed on it.
Also, the path that you are specifying is a path that is generally used by most of the web servers.
It is all about where you are installing your application on the online server. If you install the application at the same location as it is in your local, you will be able to see the pdf file in the online server too.

Trying run working Laravel project on my PC via XAMPP

I have a whole project with database, everything is working here.
Project with database
I would like to run website so I can see changes I have made.
Im using XAMPP. My configs for VirtualHost hosts and http-vghosts.conf
I have tried this https://youtu.be/iXYCnYRalaw?t=2m13s ->> from [2:13] to [4:22]
using XAMPP, but still cant run it.
Can you give me any advice or steps how to make website run on my PC? [ofcourse just for me (VirtualHost)].
Editor using: Atom
My PC spec
If running laravel appliation inside XAMPP htdocs folder is really necessary, then could you provide some kind of error, simply telling "it doesn't work" doesn't help at all.
One thing you can try is to open command prompt inside laravel folder and run
php artisan serve
This will open local server that runs current project in:
http://127.0.0.1:8000
Also, checking laravel minimum requirements is something you should check out. 5.5 requires PHP 7 and you didnt tell what XAMPP version you are running.

how to set up facebook sdk on PHP hosted on xampp on windows

I'm trying to setup the facebook marketing sdk in php but I cant seem to get past the first part since I dont know what this "terminal" is.
instructions can be found here: https://developers.facebook.com/docs/marketing-api/sdks/
I could get the composer via an alternative method. Either by getting the executable setup or by adding .php to the installer and running it via browser but the next step is
"//Then install it through composer:
php composer.phar install --no-dev"
I cant run the .phar file via accessing it in the browser. It also shows a few errors when I replace the .phar with .php and doing the same method previously by accessing it through the browser.
Basically two things I need to understand
1. Where do I input those commands on a windows 7 OS
2. Where do I place the files for the facebook marketing SDK? just under htdocs in xampp?
Where do I input those commands on a windows 7 OS
Open the command line (https://www.howtogeek.com/254401/34-useful-keyboard-shortcuts-for-the-windows-command-prompt/)
Go to your project folder and use those commands
Where do I place the files for the facebook marketing SDK?
Composer will make a directory (/vendor) within the folder that you currently are. Then composer will put the required files to the right place automatically.

How to quick launch server with winginx?

Im searching a way to start server with a bat file or by adding a prefix to a shortcut to launch a winginx program with a specific project and specific services (php, nginx, mysql)
ps: i dont need install services. Its portable server.
thanks
You can make a .bat file that will use the cd(change directory) command to change the current directory to the location of the services and then execute each service command

PHP Application Installer

I have a php application, I want to install it on another PC so they can use it but i want an automatic way that will install XAMP & copy my application files to that PC without me doing all these is there any installer I can use?
I need it to install XAMP automatically
Need it to copy files from installer & paste in the xamp folder.
Create a desktop icon so they can launch & start using it.
It will open browser, will run the apache in the background. and execute the php
anything to resolve?
Popular CMSs like Wordpress do installation just by copying the files and launching the SQL scripts for the database - create database and fill test data if needed. Which is fine.
The real question is how do you install XAMPP in the first place. Because for that it's not enough just to copy files. And even if you do manage to install XAMPP, you have to automatically start the Apache and MySQL. Don't say that it's impossible, but I think you should look for an easier way and deal with that another PC owners.

Categories