Run phar file without terminal - php

I am running a shared web hosting and I am trying to run composer.phar but i don't have acces to the terminal. And I asked the provider and said they won't run commands.
I was thinking to run it with some cpanel integrated php package but i have no idea at the moment. I appreciate any idea

Related

Linking Storage folder without using Artisan [duplicate]

I want to test some Laravel applications on my basic shared host.
Currently I just upload my complete application including the vendor files, however this takes quite long.
Since I do not have ssh access to my host I'd like to know whether there's an option to run composer / artisan commands without this.
I found this link: Use Composer without ssh access to server (Second Answer) which describes how to run composer using http://phpshell.sourceforge.net/
However, I can change folders in the console etc. But I cannot run php commands - I always get internal server error.
Check if your shared hosting provider has console feature in their CP which allows to run shell commands. Maybe you'll be able to run commands from there.
As alternative, you could right your own artisan runner and call artisan commands from the code:
Artisan::call('migrate');
To run composer command from PHP code, use shell_exec:
shell_exec('composer update');

PHP OSX XAMPP - exec mount command

Good Afternoon,
I am currently working on a PHP project which requires a php script to mount a windows shared drive. Currently building using OSX with XAMPP.
exec('mount -t smbfs //user:pass#192.168.1.1/Share /Volumes/Share 2> temp/error.txt');
Now i understand why this does not work. Its due to permissions. Apache is running as user daemon. Now i could change the user that Apache runs to fix this "challenge" but want to avoid any changes to the server if possible.
I would like to reach out and see if there is a better way to go about this.
Any ideas?
Ok, So i got it working.
I just needed the web server (user daemon) to own a folder in which the share is mounted.
EG. created a folder called "tempshare" that user daemon owns and is in the same folder as the php script (don't worry, it will be placed out of the web root when complete)
exec('mount -t smbfs //user:pass#192.168.1.1/Share /path/to/tempshare 2> temp/error.txt');
Seemed to work. Any advice on security using this method?

Is there any way we can run composer on Shared Hosting which only provide Cpanel access

I have a hosting on Godaddy which only provides access to Cpanel. I have downloaded the FuelPHP code base on the web space but not being able to run command :-
php composer.phar update
Is there any easy way out ??
Thank you in Advance. :)
Just run it on your local copy, then upload the vendor directory. That's where composer stores all the files it grabs, along with the autoloader.

Issues Deploying Site with Git & PHP (Cpanel/WHM Server)

We are trying to automatically deploy our web application using Git, GitHub, and PHP on a Cpanel/WHM server.
I've tried, using the information in the article below, to set up a deploy script on our server that GitHub posts to when we push to the repo.
https://gist.github.com/1809044
Unfortunately, it seems that the fact that apache is running scripts as "nobody" is preventing the script from running. We created SSH keys as the account's user, and the git pull command is not running.
Is there any way to successfully pull a git repo from GitHub on a deploy hook and have it update without installing something complex like Jenkins?
Do you have control over how apache runs? I'm dealing with some e-mail/spam issues. I've also been reading that if you run suPHP, your apache will run as the user of that account. Sounds like that might be what you need.

Using PHP to execute `git pull` command - deploy with github

I have been able to connect a local repository to a private Github repo (using the Github for Windows GUI), which should then automatically deploy to a development server. Everything is running smoothly until I make an attempt at the following:
<?php `git pull -f`;
Source: http://net.tutsplus.com/tutorials/other/the-perfect-workflow-with-git-github-and-ssh
Once I commit then sync/push through Github for Windows, this script is supposed to call the Linux command 'git pull -f'. I have used a SSH key without a passphrase in an effort to make it easier but to no avail. However, if I were to execute the command via command-line, everything works perfectly.
File & folder permissions are set to 777 throughout the root directory (including the /.git folder), which is what I thought was the reason for not being able to see updates when viewing the website I am developing.
If anyone has had a similar experience with this I would be grateful for a solution.
Note: I have searched high and low on SO and elsewhere on the web for a potential fix to this but any resources will be met with open arms.
Thanks,

Categories