Install or upload laravel 5.2 into godaddy plesk? - laravel-5

I am wondering if there is correct way to install or upload laravel 5.2 into godaddy plesk panel

Before Plesk 12.5 you can use zip archive and FTP.
Since Plesk 12.5 you can use Composer (Domain > Applications > Scan) with composer.json like:
{
"name": "mytestapp",
"version": "0.0.1",
"require": {
"laravel/laravel": "5.2.*"
}
}
Since Plesk 17.0 you can use Git.

Related

How do I change php version in heroku [duplicate]

I've been having issues with my webapp ever since heroku upgraded to PHP 7.2.0. How can I downgrade to a 7.0.* version of PHP on heroku?
Heroku currently supports PHP 5.6, 7.0, 7.1 and 7.2.
You can select your runtime in your composer.json file, e.g.
{
"require": {
"php": "^7.0"
}
}
to select the latest version of PHP 7.0.
A little gotcha, make sure you commit in the composer.lock file after setting the php version in your composer.json:
composer update

Composer Content-Length Mismatch

Sometimes when I run composer update to upgrade the laravel project, a content-length mismatch exception might occur.
Finally, I get this is because of the terrible firewall in China: the DNS was poisoned.
So, if you are like me, could there be a way to fix it out?
First, run:
composer config --list --global //this will get the composer home path.
[home] /root/.composer //it's my composer home path.
And then, edit the config.json, make it like this:
{
"config": {
"github-protocols": [
"https"
]
},
"repositories": {
"packagist.org": {
"type": "composer",
"url": "https://packagist.org"
}
}
}
It will make the packagist connection force https.
And also you could config the composer.json in your project, this is a laravel sample would be look like:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*"
},
"config": {
"preferred-install": "dist"
},
"repositories": {
"packagist.org": {
"type": "composer",
"url": "https://packagist.org"
}
}
}
Update
Before Composer v1.2.3 the repository key for packagist was "packagist". In v1.2.3 it was changed to "packagist.org" (see commit e38ebef).
Just change the composer default repo url:
composer config -g repo.packagist composer https://packagist.org
composer config -g github-protocols https ssh
It changes or sets the packagist repo to be used by https only.
This fixes any issues with local composer.json files too.
No need to mess around with the composer.json file localy or global.
I tried accepted answer and it was not working for me, and I tried answer from macbert and same issue, Also tried uninstall and install fresh composer. Anyway thanks to macbert and Alex Chiang I figured another solution.
I think the problem is my composer cannot download data from packagist.org server, so I changed server into a mirror. Run following command on cmd to change into mirror (I got this mirror from here)
composer config -g repo.packagist composer https://repo-eu-uk-1.packagist.org
If this is not working for you try some other mirror from https://packagist.org/mirrors
Anyway I listed down the same list here even if you cannot load the above link
Africa, South Africa
composer config -g repos.packagist composer https://packagist.co.za
Asia, China
composer config -g repos.packagist composer https://mirrors.huaweicloud.com/repository/php
Asia, China
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
Asia, China
composer config -g repos.packagist composer https://php.cnpkg.org
Asia, China
composer config -g repo.packagist composer https://packagist.phpcomposer.com
Asia, China
composer config -g repos.packagist composer https://packagist.mirrors.sjtug.sjtu.edu.cn
Asia, China
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/
Asia, India
composer config -g repo.packagist composer packagist.in
Asia, India
composer config -g repos.packagist composer https://packagist.in
Asia, Indonesia
composer config -g repos.packagist composer https://packagist.vrkansagara.in
Asia, Japan
composer config -g repos.packagist composer https://packagist.jp
Asia, South Korea
composer config -g repos.packagist composer https://packagist.kr
Asia, Thailand
composer config -g repos.packagist composer https://packagist.mycools.in.th/
South America, Brazil
composer config -g repos.packagist composer https://packagist.com.br
NOTE: I didn't try all the mirrors, you may try one by one if it is not working for you.
I had the same issue so I came here though google search.
I run composer commands both on my local machine and docker machine. I received a variety of errors on each machine when running composer install including Composer Content-Length Mismatch.
I started to mess with my composer.json file as recommended, then I realized the macbook lost it's wifi connection, like it loves to do. Additionally I am on a poor network as I am traveling. I also was warned my composer was out of date on my local machine, which I should have been using my docker VM to issue the commands anyway. My docker workspace container had not been updated for a year.
I got the wifi connection back, upgraded composer on my local machine and composer install ran just fine. I assume if I upgrade docker config that it will work there as well.
composer config -g repos.packagist composer https://packagist.jp
I had the same issue, i did two things
first updated composer, it was 1.4 updated to 1.7
secondly, change internet connection to high speed.
I had the same problem while installing laravel on my Windows machine, I was using git bash for running following command.
composer global require "laravel/installer=~1.1"
I switched to the normal command prompt then it worked without any errors.
Had some same issues based from the Github source you may also use
composer self-update --snapshot
this might produce this:
but after that it will automatically proceed and download
Solved the same issue by simply upgrading zlib(1g) [deb]
(more precisely, from trusty/14.04 to xenial/16.04, both are LTS of course ;-)
Laravel Error Content Length mismatch Solution
Only Need to run some commands
I know that's an old one, but I faced this issue for the first today.
I'm not sure if the answer here is partially helping or not, but I keep getting the same errors anyway.
The difference (though, again, it might be just a coincidence) is that further attempts seems to be partially successful:
- The already downloaded JSON are retrieved from the cache (I don't dare clearing the cache now)
- Some of previously failed ones are downloaded with success
- Other are still failing
I suppose that if I keep trying, I'll eventually manage to download all the JSON files.
It's clear that the problem is that Composer is unable to download the complete file (which is indeed quite big).
I don't think is a network issue from my side: as far as I can see, it works just fine as it always did.
What I don't understand is what changed from yesterday that makes Composer behaves like that: I didn't update Composer, PHP or other things.
Also, even supposing that I'll eventually manage to let Composer download all these huge files, the first time I'll clear the cache, I'll likely face the same problem again.
I wonder if, at least in my case, the problem is elsewhere, because all the answer I could find are pointing here and everyone seems to solve the problem: no more errors and quick downloads of these JSON files (which is not my case).

Remove laravel 5 and install laravel 4

I was about to install laravel 4 but accidentally installed laravel 5 instead, now I need to remove 5 and install 4, I tried to change in the composer the line that says: require: "laravel/framework": "5.1.", and overwrite it by "laravel/framework": "4.2.", but when I create a new project it still creates it in laravel 5 unless I point to version 4 with the creation command, any help?
Go into your composer.json folder, and edit
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*" << change this to 4.2
"torann/laravel-asana": "0.2.*#dev",
"asana/asana": "^0.1.2"
},
then run composer dump-autoload and then try to run composer update.
when you use the composer command you can specify which version you want to install you can do that like :
composer create-project laravel/laravel=4.2 yourdirectoryname
there... I also faced a similar problem when trying to do my mini project. In order to clear the old Laravel application installed Just delete the laravel. bat as shown in my screenshot. You also need to clear the cache memory
like
php artisan cache:clear
This will get rid of the laravel and your system is ready for a fresh installation.

laravel: how to install facebook SDK using composer

Friends, I am new in laravel. I don't know how to install Facebook SDK in laravel project.
Please tell me how to install the Facebook SDK in laravel project using composer.
Add:
"require" : {
"facebook/php-sdk-v4" : "3.0.*"
}
to your composer.json file.
And then run composer install

How to install PHPUnit using composer in Windows 07 64 bit?

I have windows 07 64-bit OS and I have downloaded the composer as well as I am running wampserver wampserver2.2e-php5.3.13-httpd2.2.22-mysql5.5.24-x64.exe . I have tried to install PHPUnit using composer but couldn't. I found the installation steps on linux/ mac os but not in windows. Some site suggested to add a dependency on phpunit/phpunit to the php project's composer.json file. But how? I don't know.
Please help me for the installation of PHPUnit using composer on wampserver(windows 07-64 bit OS) or any alternatives..
You do the exact same thing you would do on Linux or OSX.
As from the docs over at: http://www.phpunit.de/manual/current/en/installation.html#installation.composer.
{
"require-dev": {
"phpunit/phpunit": "3.7.*"
}
}
and run php composer.phar install --dev.
For a system wide install you do:
{
"name": "phpunit",
"description": "PHPUnit",
"require": {
"phpunit/phpunit": "3.7.*"
},
"config": {
"bin-dir": "C:/my/dir"
}
}
and add the directory to your windows $PATH.
In this case I would suggest to use Pear. Usually you don't install just couple of php classes but also you might need to configure Windows to make phpunit running as tool.
Try to have a look here

Resources