laravel 4 install failure - php

I have been trying to get laravel installed with no success.
I have been following what seems to be the usual recipe
git clone -b develop git://github.com/laravel/laravel.git myapp
cd myapp
curl -sS https://getcomposer.org/installer | php
php composer.phar install
When I run it I always get the following. I tried killing the cache dir updating etc.
Running PHP Version 5.4.6 open-ssl , mcrypt enabled in the cli.
Just don't know what I'm missing. Been giving it a shot for over a week. Saw some talk about network issues. When I manually download the json in the browser, I notice it redirects to a secure https url. Any pointers would be great. I've have never had a problem like this where I have not been able to dig up the answer.
# php composer.phar install
Loading composer repositories with package information
Installing dependencies
[Composer\Downloader\TransportException]
The "http://packagist.org/p/laravel/framework$de13d7a9bde179aa3dbe63308a250
911fa2330b3e0ba7510dea52827ec3c2f14.json" file could not be downloaded: fai
led to open stream: HTTP request failed!

I noticed with wget or a browser, I would get an https redirect. It seems that however composer does it is different enough from these other 2 that it creates a firewall problem. The link above solved it by adding a section to my composer.json file. Now it doesn't need to redirect as it is starting at https. I am running behind a sonicwall. I am not sure why it would work with a browser and wget, but not composer. It solved it however.

You're cloning the Developer branch from github. This version can be broken in the moment. So you could wait and try it later again (maybe it'll get fixed meanwhile) or you download this develop.zip which is the official way described in the L4 documentation.

Related

Unable to use a proxy: malformed http_proxy url

I am trying to run a composer command, but I'm getting the error:
[Composer\Downloader\TransportException]
Unable to use a proxy: malformed http_proxy url
What can I do to fix this error?
Here is an image showing the error message:
To solve that, set the proxy to zero using the cmd
set http_proxy=0
I must say, I encountered this issue yesterday and have gone through all kinds of hoops to get it resolved, including watching videos and reading posts (here and elsewhere), none of which worked and potentially could have lead my naïve ass to mess up my Win10 Laptop!
Delete http_proxy in Environment Variables (NO, failed to resolve)
Uninstall/Reinstall Composer (I am on dev desktop and most steps were
for XAMPP)
Remove Proxy URL virus (Various methods N/A)
uncheck Use aProxy server option (N/A)
Run multiple other terminal commands for SSL etc. (NO)
Plus multiple (outdated) YouTubes LOL
run: composer config -g repo.packagist composer https://packagist.org
Everything is N/A from: This post
This method set http_proxy=0 worked like a charm and should be made more readily available!
So thanks!
uninstall composer
after install composer
in that time http proxy field is coming
u can put that one is empty only
[1]: https://i.stack.imgur.com/fBm37.png
this problem is resolve

Error using composer to install Drupal: The system cannot find the file specified. (code: 2)

I've been trying to troubleshoot this error in many ways (including re-installing composer, clearing the cache, diagnosing composer, checking for an empty AutoRun folder in the registry etc.) I've also tried installing Drush first but get the same error.
For clarity this is my first Drupal install, but I've been very careful up to this point and no warnings or errors are showing up in my php.
I've been running the following from the admin (and default) command line:
composer create-project drupal-composer/drupal-project:8.x-dev
The full error message is as follows:
Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d3a1c9363d53fc6da4111701269496e9ca)
- Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d)
Cloning 3b9ee0d3a1c9363d53fc6da4111701269496e9ca
Failed to download drupal-composer/drupal-project from source: RecursiveDirectoryIterator::__construct(C:\drupal-project,C:\drupal-project): The system cannot find the file specified. (code: 2)
Now trying to download from dist
- Installing drupal-composer/drupal-project (8.x-dev 3b9ee0d)
[UnexpectedValueException]
RecursiveDirectoryIterator::__construct(C://drupal-project/,C://drupal-project/):
The system cannot find the file s pecified. (code: 2)
So far I haven't come across the same error posted anywhere; any help would be hugely appreciated. My next move would be to install Drupal directly from Git but I understand this is not recommended for maintainability.
Try this following command :
composer create-project drupal-composer/drupal-project:8.x-dev ./ --stability dev -vv
This can display an error token message , github have protection from web crawling, so you need to create a token on github like was indicated in message

PHP Composer does not clone symfony/assetic-bundle properly

I am trying to install Symfony on CentOS Linux wih PHP 5.6 and cPanel installed.
When I run composer require symfony/assetic-bundle , once adding bundle to the AppKernelphp, symfony (app/console too) stops working and keeps logging this error:
[10-Jun-2016 22:00:57 UTC] PHP Fatal error: Class 'Symfony\Bundle\AsseticBundle\AsseticBundle' not found in /home/avid24/public_html/app/AppKernel.php on line 19
After checking the vendor directory, turns out that composer has downloaded a single compressed file with a random name, I could extract it with unzip. but problem still exists!
This environment works properly on windows and I could easily update symfony and its components using composer.
Any help? Anyone with the same experience ?
Well, I eventually figured out the problem!
I enabled suhosin extension which prevents the composer and other similar command prompt php scripts from a proper execution.
As a temporary solution I copied php.ini and disabled unnecessary extensions and put it next to my project and call composer this way
$php -c ../composer-php.ini ~/composer ......
I'll create a script to make the life easier
I didn't find any resource which describes coexistence of composer and suhosin extension, so I'm not sure if this is the ultimate solution but the root cause is identified.
If anybody makes workaround this subject I'd be more than happy to know about it.

My Laravel installation error on localhost

I am new to Laravel, I have installed the Laravel on my localhost using
WAMP server but I am getting an error after all steps.
The errors are:
( ! ) Warning: require(C:\wamp\www\laravel/../bootstrap/autoload.php): failed to open stream: No such file or directory in C:\wamp\www\laravel\index.php on line 21
( ! ) Fatal error: require(): Failed opening required 'C:\wamp\www\laravel/../bootstrap/autoload.php' (include_path='.;C:\php\pear') in C:\wamp\www\laravel\index.php on line 21
I have used below link for Laravel installation
http://www.wikihow.com/Install-Laravel-Framework-in-Windows
I have tried to debug the issue but haven't found success in the installation.
Please let me know what is missing in installation.
You need to install Composer, open up the command prompt and cd to your directory (or hold Shift while right-clicking on your directory and clicking Open command window here) and there run composer install.
You can simplify the Laravel installation with Composers create-project command.
composer create-project laravel/laravel path
Laravel dependencies are not installed yet. That is why it is giving you this error.
https://getcomposer.org/download/
Go to this link and download composer if you haven't already.
Move the composer file to /usr/bin and rename it to just composer.
Go into the root directory of your laravel application. And run:
composer update
This will install and update all required dependencies.
In case you are on windows, which is less likely, but if you are, just download and install composer via the installer and issue the same command in you project's root directory.
Composer is PHP's dependency manager.
In the root directory of your laravel installation you will find a composer.json file. It contains the list of all your project's dependencies. If you ever need to install a package in your project, it becomes very easy. You just have to edit the composer.json file and let it know which package you need. Issuing composer update will install new package listings and update all existing ones.
just to be clear I'm not big fan of wamp.
I've just took quick look at the
http://www.wikihow.com/Install-Laravel-Framework-in-Windows
and I suppose laravel framework is not going to work best with point 11 to 14 modifications.
Baseline for laravel to work is you need to http serve /public folder in a properly configured environment (after composer install and create-project as described earlier).
If you want to take full advantage of laravel you need to often cli `php or composer (at least)` efficiently.
While using laravel I suggest installing PHP and MYSQL yourself from scratch (it really takes few minutes) and using convenient IDE (like PHPSTORM for example).
Nowadays PHP has builtin http server, so you don't need any http server in your dev environment.
So in Windows:
Install PHP and enable required libraries in php.ini
Install and configure local mysql server (easiest way installing via MySQL installer)
Start development server by invoking php.exe -S localhost:80 -t "absolute-path-to-your-laravel-installation\public" like for example C:\htdocs\laravel\public via commandLine
Enter url in your favorite browser http://localhost
Hope that will help to get you started.

Using Composer PHP on Shared Space

I'm using Bluehost and do have access to SSH, thankfully. I've also set my PHP to 5.4 in the Control Panel settings. Now, here's the two big questions that I can't seem to grasp: how do I install Composer and furthermore, after installing Composer, how do I get the dependencies included?
In this case, I am attempting to use the official Tumblr PHP Library, which has dependencies -- all of which can be found on Packagist.
I've referred to this question in which the OP is using HostGator. I have attempted to install Composer in a similar fashion and have done so with seemingly successful results. The issue, however, is that I don't know where to install it on Bluehost so I now have Composer installed in several random places on the server simply because I don't know how to navigate to find where to put it in this shared space.
I know this is the issue (i.e. it's installed in the wrong place) because when I use the composer phar files and syntax to install the packages, I get errors saying the commands don't exist.
I really hate asking for hand-holding assistance, but if someone could walk me through the proper installation of Composer on a shared space and the proper installation of a Composer package from Packagist on the same shared space, it would be much appreciated. I've dug through the Composer documentation and can't seem to find a proper guide -- if one can even exist -- for this case. At this point, I'm wondering if it's going to be different for every web host.
Once you install composer as mentioned by KLVTZ. In the bluehost environment, use the php-cli instead of php.
php-cli composer.phar install
When installing composer, the biggest problem I ran into was that Bluehost's command line php was 5.2 and composer needs 5.3+.
Fortunately, Bluehost does give you access to 5.4. You can find it at
/ramdisk/php/54/bin/php54-cli
I ended up setting up an alias to call composer.phar using the above php command and it's worked great. You can see more details on how to install composer on bluehost.
You should probably not use Composer on the remote host, but instead install it on the local machine that is used to upload your project to Bluehost. There you can manage all the stuff that is needed to fetch the dependencies, which might include having the ZIP extension enabled or having a ZIP program available, having GIT or Mercurial installed if you have to grab a version from a branch, and so on.
All these dependencies of using Composer might not be available on that remote host, and frankly: You really do not want to install these development tools on a production machine anyway, I think. Any software that potentially helps an attacker shouldn't be present if it can be avoided.
The issue, however, is that I don't know where to install it on Bluehost...
In order to fix this problem, you need to figure out where exactly your project folder is. Composer needs to be installed in that folder. If you have access to a UNIX shell, I recommend that you change your directory to that project folder
cd $_SERVER['DOCUMENT_ROOT']/project_folder/
Generally, your remote server will follow the same file directory tree as that on your local machine. However, if you are unsure as to how your file structure may be organized, you can always print working directory of your local machine:
pwd
After you have successfully located the correct file path on your shared space, simply install composer:
curl -sS https://getcomposer.org/installer | php
This will report back something like:
All settings correct for using Composer
Downloading...
Composer successfully installed to: /var/www/my_project/composer.phar
Use it: php composer.phar
You now have access to your composer.phar in your project. Let me know if you need any further help.
One problem on Bluehost is that the php command on Bluehost does not execute php-cli. So I "bypass" that by having my own php script earlier in the PATH and then forwarding the arguments to php-cli. In the same process I made script named composer which calls php-cli composer.phar directly.
So, this setup has worked for me on Bluehost:
In ~/bin I have the composer.phar and two bash scripts called php and composer. In ~/.bash_profile I have prepended ~/bin to my PATH.
~/bin/php looks as follows:
#!/bin/bash
php-cli "$#"
~/bin/composerlooks as follows:
#!/bin/bash
php-cli ~/bin/composer.phar "$#"
And the additions to ~/.bash_profile are these:
PATH=$HOME/bin:$PATH
PATH=$PATH:$HOME/.composer/vendor/bin
export PATH
(I have also added ~/.composer/vendor/bin as can be seen, this is handy for global access for some composed applications (for me that is laravel)).
Remember to source ~/.bash_profile. (Or reconnect)
I think you should do something like this.
In console
echo $PATH
Use one of these pathes
mv composer.phar {selected path}/composer
chmod +x {selected path}/composer
Now you can simply call composer everywhere
If you have composer installed in your root directory (under public_html), might be something related to PHP version. As Bluehost when chosing PHP version "Be aware that this only modifies your ~/public_html/php.ini file. If you choose to use PHP 5.4, you'll want to make sure your crons use "/usr/php/54/usr/bin/php" instead, as otherwise it will use PHP 5.2."
So you can try with the command
/usr/php/54/usr/bin/php-cli composer.phar install

Categories