I'm running my PHP application on Google Cloud App Engine Standard. After I deployed a new version of my app with a new composer package, I see that this new package was not installed during the deployment.
I deploy my app with gcloud app deploy. In the Cloud Console Debug tool, I can't find the package in the vendor folder. The package is successfully installed locally.
Is there a trick to update composer packages?
I had this problem too. Turns out this only works for '2nd generation run times'. In other words, your application will need to be PHP7.3. php5 applications will not process composer files.
Related
I'm new to cPanel and I want to deploy my Symfony2 app on it.
I need some guidance on how to do it,
I downloaded the Symfony2 framework with the Softaculous Apps Installer.
PS : My app is also on BitBucket.
First off all: CPanel is just a web-shell arround your linux os that makes it easy to maintain your server from distance through a web interface.
Actualy you do not need softaculous because it just installs an empty new symfony project.
There are globally two ways to install your symfony project.
Install git and Composer on your server, use git to pull the project from bitbucket and install the the vendors with 'composer install' or 'composer update'.
Upload your complete project from your local computer to the server with FTP.
In both ways you still have to install your database and set your configuration.
If you have a shared online server then just copy the entire symfony project through FTP, set up your database credentials in parameters.yml, and manually delete the prod directory inside var (symfony ≥ 2.8) or app (symfony ≤ 2.7).
I am using azure app service My application requires Predis extension to be installed on the server, how can I have it installed on App services? Application is in PHP.
You can package the Predis SDK in your application and deploy to Azure Web Apps Service together via GIT or FTP. Create a PHP-MySQL web app in Azure App Service and deploy using Git for more info.
Additionally, you can just simply configure the Predis SDK in composer.json.
"require": {
"predis/predis": "1.*"
}
Then install the composer extension in your Azure Web Apps Service. Then when you deploying to Azure via Git, the Azure deployment task will run composer install command to install the dependencies and composer commands configured in the file.
You can refer to How to install composer on app service? for installing composer extension
Additionally, if you leverage Redis Cache in Azure, you should Enable the non-SSL endpoint for PHP integration at first:
And the code snippet:
require 'vendor/autoload.php';
$client = new Predis\Client('redis://{your_redis_service_name}.redis.cache.windows.net');
$client->auth('{password key}');
$client->set('foo', 'bar');
$value = $client->get('foo');
echo $value;
I just started my laravel course with laracast. I dont quite understand yet all the enviornment-related things.
I know that Composer is a kind of a program that downloads pre-written scripts to use in your project. But where does it work? On my local machine or on my vagrant homestead box VM? On which of these is it supposed to be installed?
I installed myself vagrant homestead box already but does it contain composer? When I go ssh into my guest machine and go to vagrant#homestead:/vagrant$ path I can see composer.json and composer.lock files, but does it mean that I have composer installed?
Composer is a PHP package manager, like npm for javascript or pip for python. There are many examples of package managers. It's useful, because adding dependencies to your php projects can be a pain, but composer makes it really easy. You just add the dependency to composer.json and you can use it right off the bat.
Composer isn't laravel specific, you can use it in any php project, laravel uses it to manage it's dependencies, laravels dependencies use it to manage their dependencies and so forth.
If nothing else, the composer autoloader is great, so you can use it even if you don't plan on using external packages.
Homestead should come with composer installed. A composer.lock file is generated when you run a composer install or composer update. If you plan on creating or using other php projects on your machine, it's probably a good idea to have composer installed on your machine as well.
After running the php GoogleAppEngineLauncher launching it and then restarting the command line gives as follows
gcloud auth login
-bash: gcloud: command not found.
Two weeks ago there was another step that is now missing in the docs along with components update. Please advise if this is still necessary.
Note I have the following in the /usr/local folder.
google_appengine
google_appengine.old
Currently installing 1.9.23 on a Mac OS 10.10
This is an issue caused by relying on GoogleAppLauncher instead of installing and using gcloud. (You should be able to do both).
Installing gcloud
Start here to make sure you have gcloud installed.
I doubt gcloud is packaged with GoogleAppLauncher, but I have not confirmed.
Why isn't it already like this?
https://cloud.google.com/appengine/downloads explains that symlinks may be created when installing the MAC version. If you skip this, you won't have access to appcfg.py or the appengine specific includes.
gcloud is a larger SDK package which manages all google cloud components. It has always been best practice for us at Loudr to use gcloud across the board.
I'm trying to add FosUserBundle and HWIOAuthBundle to my symfony project in openshift. In localhost, to add those libraries, I'd to edit composer.json and update the composer.phar. Now I don't know how to update the composer.phar on openshift.
My way(step-by-step):
Create a symfony app from openshift
clone the project to my localhost
edit the composer.json and push it again to openshift
after that, what should I do to update the composer? Or is there another way to add those libraries to the symfony project?
You probably need to setup an action_hook to run the composer command on the openshift server after you do a git push, maybe in the deploy action_hook. Another idea would be to install the libraries locally using composer and then add them into git and push all of it up to the server with a git push and let it all be deployed together. As far as I know composer is not installed on the server, so you may need to install it into your app-root/data directory and call it from there with your deploy hook.
Here is a blog article about using composer with OpenShift: http://stanlemon.net/2013/03/22/composer-on-openshift/ that might help answer your question