Laravel 4 - php artisan migrate error - laravel

when I run php artisan migrate I receive this error:
Fatal error: Call to undefined function J20\Uuid\openssl_random_pseudo_bytes() i n C:\xampp\htdocs\blog\Laravel-4-Bootstrap-Starter-Site\vendor\j20\php-uuid\src\ J20\Uuid\Uuid.php on line 32
I'm trying to install this app, https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site
I appreciate any help, since I have no idea how to deal with something in the vendor dir halting migrations.

Make sure you enable the openssl extension in your PHP.ini file by removing the comment from the following line.
;extension=php_openssl.dll
So that it looks like this.
extension=php_openssl.dll
Then restart Apache to make sure the changes take effect.

Related

Laravel - compact(): Undefined variable: operator in Builder.php

I have PHP version-7.3 installed in my system and Laravel-5.8. When I tried to rub composer install or composer update on an old Project with Laravel-5.4 and PHP Version-5.6.4, I got this error shown below:
In Builder.php line 1229:
compact(): Undefined variable: operator
Script php artisan optimize handling the post-install-cmd event returned with error code 1
Then, when I tried to run the application, I got this error page as shown on the screen:
I tried to run:
php artisan cache:clear
and
composer update
but the problem is still there.
How do I get it resolved?
Thank you.
It looks like this issue was fixed in Laravel 5.5 according to this post: https://github.com/laravel/framework/issues/26936#issuecomment-449479336
Since Laravel 5.4 is no longer supported, your best option might be to upgrade. You can find a list of the currently supported versions here: https://laravel.com/docs/releases
The minimal upgrade that should still fix the error would be 5.4 to 5.5. The instructions can be found here: https://laravel.com/docs/5.5/upgrade#upgrade-5.5.0 (please note that support for 5.5 has also ended, but it might still fix your bug). This would also require you to switch the project to PHP 7.0.0 or greater.
If:
You can't upgrade for whatever business/team related reason and
Are sure that the Homestead box is running the correct version of PHP (7.2 or lower based on the answer given here) and yet
are still getting this error,
explicitly define the PHP version on the Homestead.yaml file. This should be done on the sites property as such (each is a new line, of course):
map: test.appp
/home/vagrant/code/test/public
php: "7.1"

Fresh CentOS 7, first Laravel Installation.Composer install breaks

I am fallowing this tutorial:
http://linoxide.com/linux-how-to/install-laravel-php-centos-7-ubuntu-15-04/
And on step 5) when running composer install in the project directory it starts to do staff, as expected, until this happened:
Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
Script php artisan optimize handling the post-install-cmd event returned with error code 255
What is the problem?
Thanks, Aleks
start creating a project (after updating composer) instead of downloading the referenced file do the following
from your terminal type in cd /var/www/
then type composer create-project laravel/laravel laravel-develop
your composer should download the latest version of Laravel
try it this way feel free to ask any questions.
Good Luck

Cloudstack client installation

I have XAMPP installed on Windows 10. And have successfully installed Composer, Laravel. I can see the basic Laravel project page on my local server.
Just to try things out I also installed yii2. I can see the basic yii2 page also on my local server.
Now I'm trying to install this Generic Cloudstack Client:
https://github.com/PCextreme/cloudstack-client
In XAMPP, under htdocs I have this dir called 'LaravelProjects'.
dir structure
First I made the project with the laravel command:
laravel new PCextreme
Then in PCextreme directory I give the command:
composer require pcextreme/cloudstack-client:~0.1
The composer breaks and shows Conclusion: remove laravel/framework 5.2.41
But in the instructions there is another method to install the package.
When I do that by editting the composer.json in the main Laravel dir. 'LaravelProjects' under xampp/htdocs with these lines:
"require": { "pcextreme/cloudstack-client": "~0.1" }
And then I run the "composer update" command.
I don't get any error.
But as soon as I follow these steps:
Once the package is installed you need to open app/config/app.php and register the required service provider:
`'providers' => [
'PCextreme\CloudstackClient\Providers\LaravelServiceProvider']`
The application breaks.
I can't see the basic page showing 'Laravel 5' on my server anymore.
Instead of that I get a fatal error:
Whoops, looks like something went wrong.
1/1 FatalErrorException in ProviderRepository.php line 146: Class
'PCextreme\CloudstackClient\Providers\LaravelServiceProvider' not found
Further in the instructions, when I give the command below:
php artisan config:publish pcextreme/cloudstack-client
I get this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'PCextreme\CloudstackClient\Providers\LaravelServiceProvider' not found
I have tried out different things that I could find on internet but nothing seems to work in my case.
Could someone kindly help me out with this? Any help is greatly appreciated!
Execute in you project folder command: composer update

Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE

After installing laravel we get an error:
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in C:\xampp\htdocs\laravel\public\index.php on line 50
Laravel 5.1 uses the ::class property to get string representations of a fully qualified classname. The error you're seeing is caused by this line
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
This language feature has been introduced in PHP 5.5 which is a requirement of Laravel 5.1. Your installed PHP version is probably older than 5.5. Try to update your PHP binary.
In case you are interested in why ::class is used, take a look at this answer
Same thing happened to me also. I found that web server was using my old PHP version 5. To solve it for me, I did this -
sudo a2dismod php5
sudo a2enmod php7.0
sudo service apache2 restart
Your php version is too low.
Try version 7.0 or later php.
Your PHP version on your Xampp is lower than 5.5.9 as specified in the Laravel 5.1 doc.
Simply uninstall your current Xampp software and download a fresh copy at Apache website with this specification 5.6.12 / PHP 5.6.12 .
Do not forget to collaborate with your host provider to ensure that your hosting account runs the required PHP version (>=5.5.9) during the deployment of your Laravel 5.1 app online.
I was facing the same error but error was in app/User.php line 10.
Actually, line 10 was ok but before line 10 I was missing some php syntax.
After correct the php syntax error It was fixed. So you have to check C:\xampp\htdocs\laravel\public\index.php on line 49 carefully I am sure there is something wrong. Just try to correct. It will be fixed.

laravel 4 install issue when using composer install

When I run
composer.phar install
I get this error almost at the end of the installation, any ideas?
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/belendez/public_html/laravel/artisan on line 46
Parse error: syntax error, unexpected T_STRING in /home/belendez/public_html/laravel/artisan on line 46
Script php artisan optimize handling the post-install-cmd event returned with an error
I look into the suggested link and it appears that somehow in the middle of the installation it changes from 5.3 to 5.2! If I try to start installation using 5.2 it returns right a way: class 'Phar' not found. Any ideas?
It seems that issuing only a php command will pick up another version of the interpreter. Try to change all the references to php in your composer.phar file to the one you want actually to be executed (in your case it seems /opt/php53/bin/php).
You can confirm that by simply launching a php -v directly from the command line to see what version your server will pick up

Resources