php artisan optimize times out only on composer install - php

I'm running a laravel app on Azure. Things are moving in the right direction, composer install didn't use to work at all. Now however, the "php artisan optimize" command times out:
However, running "php artisan optimize" separately is no problem at all:
What could be the cause of this?
Edit:
Deleting the symfony-folder does not help, it is not present when I run the "Composer install"-command:
Increasing the timeout-limit does not help either, I increased it in both azure and in the composer.json file:
This still gives me a timeout, after installing the symfony-components again:
...

As I deployed a new clean Laravel 5 application to Azure Web apps and tried to reproduce your issue, however, it worked fine on my side either I run the command php artisan optimize or composer install or composer update.
I installed the composer at the Site extensions at the KUDU console site of the application on Azure Web apps, the url should be like: https://<your_site_name>.scm.azurewebsites.net/SiteExtensions/#gallery
There are several solutions of other developers who occur the same issue with you, you can try these solutions:
try to increase the max_execution_time or set the value to 0, refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-configurations to change the PHP build-in configurations on Azure Web Apps. And you can change the process-timeout in Composer.json file :
"config" : {
"process-timeout": 0
}
deleted the entire Symfony folder and try again. As the comments at PHP Artisan Optimize - Timed out? #1050, it seems the symfony dependencies raise the issue.

#Rkey,
According to my experience, I think the issue is more related to the symphony version/configuration. I suggest you can remove/edit the symphony configuration from the composer.lock file (NOTE: please backup this file if you cannot success, you also can recovery your environment). And then you can run this "composer install".
After installed component, You can see an alert window which shows that
your session is timeout, please refresh your browser.
You can see this information because the server is in initialization process.
Any concerns, please feel free to let me know.

I'm also having this problem. Will upgrading the plan help?
According to this upgrading to S3 helps... I haven't tried it though... Let me know if it really works.

#Rkey & #cabs, per my understanding on this question, I wanna point out that Composer is not fully supported on Azure. The issue is that it’s using Taskkill command which is blocked on Azure. We are aware of this and please feel free to submit an idea or suggestion based on the experience with Azure at https://feedback.azure.com/forums/34192--general-feedback.

I have been stuck in this problem as well for a week.
Have tried all solutions on forum but no success.
This morning finally solved after reinstall XAMPP. It was problem on my previous PHP version 5.6.19. While using new XAMPP with PHP version 5.6.28, it worked fine.

Related

My laravel project start page is not opening

I have install Laravel in my pc using composer.
I used gitbash and started xampp control server
First I've changed my directory.
Then I've ran a command composer create-project laravel/laravel project_1. After the command had run, it installed laravel and all necessary file and key was successfully set.
Then I again changed my directory to project_1
Then I ran another command php artisan serve. After running this command Laravel development server started and 127.0.0.1:8000 this ip has genrated.
I copied the id and paste it in my browser url bar.(I copied and pasted it without using keyboard. I only used mouse)
but when I provided the ip the project_1 starting page did not open.
The page was loading and it is still loading.
what can I do? Please help
logs folder
Here is my contribution, I cannot say what is the cause but I have a solution for it; because I have such as a challenge.
run
php -S 127.0.0.1:8000 -t public
Note that the 8000 is your port, and this could be any 4-digit number.
I hope this helps
Every thing you did seems right to me in terms of Laravel requirements, so lets check some other possible issues:
make sure that your internet connection isn't configured to use
proxy, if so make sure you excluded your local address.
if you are using Internet security suite software, make sure it doesn't block your requests, this vary from software to another but you might test this by deactivating the software for a while until you try.
now that's what I have in mind, I hope it help.
First, stop the php artisan serve
After changing directory go to inside your project folder, you can run php artisan serve. Then a localhost URL will be generated for you where you can see your project in the browser
If you have PHP installed locally and you would like to use PHP's built-in development server will start a development server at http://localhost:8000
Please try to install Laragon and forget about Xampp for now. This is really cool tool and you'll start much quicker. I did try to resolve few issues with Xampp myself and always wasted a lot of time. You can google tutorials later for it as well. Plenty of info out there.
As well it comes with in house installer for Laravel ;) and more :).
Make sure that you are not coping the url from Git Bash through command, it will stop running the project
Make sure that you are not using antivirus specially avast antivirus.

Unable to install TastyIgniter

I have downloaded TastyIgniter from GitHub and running it in localhost (Windows with WAMP and PHP version 7.1.9). In the last step of installation, I am getting errors that "Downloaded files from server are corrupted" and "Missing vendor files". May I know what is causing these errors and how I can run it without bugs in my localhost.
Run composer update command in the root of your project.
If composer is not installed. Download it from this link official website.
it seems like they hardcoded something.
when you unzip the setup-master folder, keep it as it is and don't rename or move its content.
start your installation by calling:
yoursite/setup-master/setup.php
this worked for me.
I tried to run the installation previously by unzipping the files directly in my html folder and tried several fixes but no success.
after a successful installation you need to forward in your apache config / .htaccess file to the subfolder
In order to do so, don't forget to perform the Post-Installation steps mentioned here:
https://tastyigniter.com/docs/master/installation
I finished by aborting tastyigniter. After a successful installation and theme activation, the application worked fine then "suddenly" it throws an exception that the newsletter component can't be found. All suggested helps on the dev forum didn't help. Even after reinstalling the application it comes to the same error.
Apparently you won't come over a "professional" installation support by the developer ($$$)
Thats pretty much my experience, I tried to install in different servers and environments running into several issues, especially it seems not to be made for anything other but specific development environment. Trying to secure installation with SSL already is an issue, that is very standard but poorly documented with this project. Having an example of how configuration files nginx go! Pay or have an experienced server admin do the trial and error. Integrated update mechanism, get your staging server and help to code. It is ok, just would be more honest to mention upfront, that running that app in production environment requieres some serious server administration skills and is nothing like installing and maintaining a wordpress or any other mainstream script.

Deploying Laravel 5.4 to Shared Hosting

I've got a real head-scratcher for you! I've been working on a Laravel 5.4 application for quite some time now and up until yesterday I had been able to:
develop on my local machine [still works flawlessly],
push my changes to my BitBucket repo [still okay here],
and would subsequently pull those changes to my shared hosting server (RedHat) [still running smoothly],
I then run my dependency managers (npm and composer) to get the project in place and functional
there is some matter with clearing various caches:
php artisan view:clear
php artisan route:clear
php artisan cache:clear
composer dump-autoload
and finally move my '/public' folder to the web root and update index.php to point back to the 'bootstrap/autoload.php' in main project structure,
I am aware there is likely another or several steps I am missing, but I am unsure what they are...
All that being said, I've attempted to deploy a number of applications using Laravel lately and I always seem to run into the same issue come time to deploy an application to production. I've read 30+ tutorials on the matter and nothing seems to explain the issue why my site isn't working any more.
I've checked the error log file maintained by Apache, it's empty.
Was wondering if it's a permissions issue, doesn't seem to be the case (all folders set to 775 and files set to 664 as specified by various sources and owned by serverName:userName)
Browser console simply shows a 500 server error.
All I see if "Whoops, looks like something went wrong." twice.
There must be some way to show better error details (config debug setting already set to true)
Any suggestions at this point would be beneficial to send me looking in the right direction!
======= UPDATES =======
For the sake of thoroughness, and that this save others from severe headaches, I'll be posting actions taken here.
Following tutorial mentioned by #user123456 (permissions applies)
Generate new key for application
Run php artisan config:clear
Off to the races, answer to come!
You need to ensure you have a working .env file.
Once done, run php artisan key:generate to create a key for your application after which you should clear your application's cache as follows php artisan config:clear
I would never recommend using shared hosting for Laravel application. You will face lots of issues for permissions, composer and external dependencies. Instead, you can use cloud servers like DigitalOcean, Linode, vultr and deploy laravel application on them. If you don't know about linux and creating Stacks you can use Cloudways to deploy laravel.
https://dev.to/rizwan_saquib/deploy-laravel-application-on-cloud-easily-with-cloudways

Composer/Laravel Installation: My command line no longer understands the PATHs

running mac Yosemite 10.10.5
A couple of days ago I installed Laravel for the first time. That part went pretty smooth! Once it was time to install composer I was able to find some help here! This command on bash Profile made it work for me: PATH="$PATH:~/.composer/vendor/bin"
Fast-Forward to today when I am attempting to install XAMPP and Bitnami.. The Apache server and all that. So I think I am ready to roll and as I tried to create a project I was told that I did not have the mcrypt file? So down THAT rabbit hole I went. That was a tough one but I managed to get it to work.
Now forgive me but I don't remember what happened next that led me to re-install composer and that turned out to be an other huge issue as it wouldn't allow me to do so.. I would get this message
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The detect_unicode setting must be disabled.
Add the following to the end of your `php.ini`:
detect_unicode = Off
After doing some research I was able to download Composer again by running this command..
curl -s getcomposer.org/installer | php -d detect_unicode=Off
I thought I was on my way.. 2 hours have gone by! Boy was I wrong! :(
What once used to work.. composer commands in my terminal.. all of the sudden are not recognized..
Commands like this worked before.. composer create-project laravel/laravel=5.0 TestApp
but now it returns this.. ??+?abelista /Applications/XAMPP/htdocs Question Marks along my machines name..
Nothing with composer runs.. I have tried changing my PATH in my Bash Profile too..
PATH="$PATH:$HOME/.composer/vendor/bin"
PATH="~/.composer/vendor/bin/laravel:$PATH"
and remember this one below used to work..
PATH="$PATH:~/.composer/vendor/bin"
From my understanding.. If I can recall correctly.. I think the problem began when I ran homebrew to install mcrypt.. I could be wrong. Does anyone here have the slightest idea what could be my issue?
BTW, according to my command line.. composer is installed..
All settings correct for using Composer
Downloading...
Composer successfully installed to: /Applications/XAMPP/xamppfiles/htdocs/composer.phar
Use it: php composer.phar
Thanks for reading and trying to help me out.
I think you've messed up with PHP installing XAMPP or other tools...
Nothing to do with composer. If you want something to work, try using Homestead, everything is setup for you in there.
In general, I would recommend you to not install stuff directly on your development machine. Try using virtual machines instead, that way you can do all the mess you want and reset everything easily.

Why are my custom laravel artisan commands not available in production environment

I have just installed a laravel app on the "to-be" production server (1and1 shared linux server).
With the same codebase as on my development server (Ubuntu 14.04 lts) my custom artisan commands are not available (php5.5 artisan list) on the production server.
I have done composer dump-autoload already.
I have also checked the app/start/artisan.php file and that is OK and is executed.
I have checked the app/config/production/app.php for the service providers and they seem to be all right.
I have also spent the better part of the day here on stackoverflow to find a solution, but without much success.
My Laravel version is: 4.1.28
Thanks so much for any help.
If you are getting no errors, you probably don't have the same codebase in production because, if resolve commands in your artisan.php file:
Artisan::resolve('CommandName');
And Laravel doesn't have access to this class, it will raise an exception:
"ReflectionException","message":"Class CommandName does not exist"

Categories