Openshift and HtmlServiceProvider - laravel

I have pushed my local app to openshift and now get the following error message
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /var/lib/openshift/5728b9782d5271802600015c/app-root/runtime/repo/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 150
How do I fix this on Openshift?
The solution locally would be to run composer update but how do I run that command on Openshift? I know there is rhc command line tool but is it possible to do a composer update with rhc?

You should check for the files first. You may have corrupted/missing files during upload. If you do not have vendor directory, you shoudl run composer update.
If files are there, run composer dumpauto on the server.
You can connect to you server with SSH and run these commands from terminal.
If you do not have access to SSH, you could try to run there commands using small PHP script with shell_exec('composer update'); clause in it, or just upload all vendor files manually.

I got ssh access and did the commands necessary to correct the problems

Related

how to fix error laravel 5.2 "failed to open stream: No such file or directory" without composer

I've got this error in my laravel 5.2 project who hosted in debian linux
Warning: require_once(/home/u706561288/public_html/sap/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
Fatal error: require_once(): Failed opening required '/home/u706561288/public_html/sap/vendor/composer/autoload_real.php' (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
so many forum like stackoverflow tell me to using php artisan "composer update" but
unfortunately my hosting package not available to composer instalation
please tell me how to fix this problem
I suggest that you test these steps
On the Localhost, run these two commands (composer update and composer dump-autoload)
Re-upload the entire project on the server
Also, if the problem is not resolved, you can delete the ‍Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again.
When the hosting service or some PC does not allow to install Composer and appears error like in my case, follow these steps:
Delete all laravel project in hosting service. I recommend to use smartftp for good speed file access and tracked action.
Back to our localhost project and run composer install --no-scripts command and then composer clearcache.
Reupload all laravel project.
Don't forget to configure .env file.
I hope this can help with the same problem in future.
I had the same error while back, what I did to solve it was. I delete all the vendor folder from the root project then install it back by executing composer install
delete the ‍Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again
this helped me
If anyone still facing the issue after deleting the vendor directory and did composer install try to update your composer by composer selfupdate then do the same install process.

Laravel Artisan not working at all after clone

I have this weird situation: I've cloned all my repositories from github in a new local machine running Mac OsX some of them has Laravel framework installed but only some of these can execute the cmd php artisan.
I've tried to check permission on folders, uninstall/re-install composer and I've also tried to install a fresh version of Laravel. Another problem is that running the command doesn't output anything - no errors, nothing - only a new empty line of the terminal.
The only thing I know is that if I clone one of the repositories, then run composer install it throws Script php artisan optimize handling the post-install-cmd event returned with error code 255.
Thanks
Update 1:
I've found running composer install -vvv -o that composer throw this error
Warning: require(/Users/USERNAME/laravel/bootstrap/autoload.php): failed to open stream: No such file or directory in /Users/USERNAME/laravel/artisan on line 16
Fatal error: require(): Failed opening required '/Users/USERNAME/laravel/bootstrap/autoload.php' (include_path='.:') in /Users/USERNAME/laravel/artisan on line 16
Update 2:
It seems that cmd git clone didn't copy that autoload file bootstrap/autoload.php for some reason that I don't understand at all.
I've imported the file manually from github and run, removed the vendor folder then run again composer install --no-scripts but still having the problem with artisan and if I run composer update it throw Script php artisan optimize handling the post-update-cmd event returned with error code 255
I had to re-install laravel and copy files manually to make it works again.

Can't execute composer.phar in shared hosting

I've installed Composer on a shared-host (hostgator) following this guide:
https://laravel.io/forum/02-13-2014-how-to-install-laravel-on-a-hostgator-shared-server
It was installed using this command:
curl -sS https://getcomposer.org/installer | php
When I try to run composer I get the message "/home2/georger/composer.phar: no such file or directory" although the file does exist, I can open it. Other questions that deal with this suggest moving it to /usr/local/bin but that's not an option for me.
As outlined in the installation instructions, you will need to pass it to the php interpreter:
$ php composer.phar
Alternatively, you might want to reconsider whether you really want to execute composer in a production environment or rather execute it during the deployment and then deploy the artifacts. In other words, you probably want to run composer install on the machine from which you want to deploy to the production system, and then synchronize files from there to the production system, for example, using rsync.
For reference, see https://getcomposer.org/doc/00-intro.md.

Cannot open file "/tests/ExampleTest.php" Laravel5 using Windows10

i am running phpunit testing in laravel5 on windows 10,and getting this error by running the following command.
Cannot open file "/tests/ExampleTest.php",
D:\wamp64\www\forum\vendor\bin>phpunit /tests/ ExampleTest.php
Can you please suggest me what could be the issue?
Its seems that "phpunit" is not installed globally,try run this command from cli to install it globally and then you can use unit testing globally.
"composer global require phpunit/phpunit"

Running symfony3 on Openshift, composer not found

I recently discover OpenShift and look exactly what I needed. Now I'm trying to running a simple symfony3 project on it. I create an application with this cartridge (since I need php 5.5), successfully installed after waiting some minutes ,and then upload a symfony project from my local laptop to the created www folder. Now I'm lost on how to activate composer to install and update vendors.
I read this link, and as it say I create an empty file called use_composer in the marker folder. Then I login with a putty client, go to my project folder(app-root/runtime/repo/www/symfony/), but executing composer install on it give me 'composer: command not found'. I'm sorry if it's a newbie question, but in fact I'm not a linux user. Maybe I need to restart the application or something.
Any help will be appreciated.
I find an answer from this article
Execute curl -s https://getcomposer.org/installer | php -- --quiet --install-dir=$OPENSHIFT_DATA_DIR
Now you can call composer like this php $OPENSHIFT_DATA_DIR/composer.phar update

Resources