phpmyadmin 500 Internal Server Error after sudo a2enmod rewrite - laravel

I configure my server for Laravel app with the composer. this is installation process:
apache2
PHP
MariaDB
phpmyadmin
until here the phpmyadmin works. but after Laravel installation and specially using sudo a2enmod rewrite for registering VirtualHost, I get the 500 internal server error on phpmyadmin. whats the problem?

First, you need to check error here the : nano /var/log/apache2/error.log
In my Case Error was .htaccess: Invalid command 'Header', perhaps misspelled
Solution :
sudo a2enmod headers
/etc/init.d/apache2 restart

Related

In Laravel - could not find driver on xampp using ubuntu 16.04

I am working on xampp 7.3 version of PHP.
I am facing the below error.
Illuminate\Database\QueryException: could not find driver (SQL: select name from table where id = e690ddc2-a2b6-4aad-8a73-dab1771c0ea6 limit 1) in file /opt/lampp/htdocs/ProjectFolder/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 669
Also, I have uncommented the pdo_mysql.dll in php.ini file it still giving me an error.
Also, it is working in the windows system but not in Ubuntu16.04.
how can solve this?
You should install the necessary packages
sudo apt-get install php*-mysql
Then uncomment the MySQL extensions on php.ini and restart your server
sudo service apache2 restart
In your project set the correct parameters and in the root of your project run
php artisan config:cache
I resolve this issue on Ubuntu 18.04 by:
"Control C" out of the php artisan serve command to stop the application.
Stop all the servers running on XAMPP -> (Apache, MySQL and ProFTPD).
Enable mysql inside of XAMPP via path $ cd /opt/lampp/etc .
$ sudo nano php.ini or open in your choice of text editor. I use PHPStorm.
Search for "php_mysql.dll".
Removed the ";" in front of ";extension=php_mysql.dll" -> hit save.
Back in the terminal -> $ cd.. back one folder into the /opt/lampp.
Run $ sudo apt-get install php*-mysql. -> Could take a couple minutes based on your internet connection.
After the install is complete -> restart all the XAMPP servers.
Run $ php artisan config:cache.
Run $ php artisan serve.

404 error: Page not found. (Magento 2 fresh installation ubuntu 18)

I made fresh installation of magento 2.3 on ubuntu 18. I have imported existing database that I have already used in that project in previous installation. Now I am getting error 404 for homepage, admin and all related urls in that project.
I have fixed paths in core_config_data table but it didnt helped.
I have solved my problem.
If someone encounter the same problem, the key is to enable rewrite mode in apache.
Execute next commands:
sudo a2enmod rewrite
sudo systemctl restart apache2

How to enable php-Mcrypt extension in Laravel Homestead

I am trying to get an old Laravel 4.1.x app up and running again so that it can be modernized. This requires an environment with PHP 5.6 and the Mcrypt extension. I have installed Homestead 9.0.3 (the latest stable version). Within the VM, I have set the PHP version to 5.6
sudo update-alternatives --config php
I have then installed the php-mcrypt extension
sudo apt-get install php5.6-mcrypt
I am now able to create a new Laravel 4.1.x project, which is a process that requires Mcrypt to complete, so we're certainly getting somewhere:
composer create-project laravel/laravel="4.1.*" myAppName
However, when I browse to the webpage for myAppName, I see the message:
Mcrypt PHP extension required.
I have also tried steps that are usually recommended for this problem, ie:
sudo ln -s /etc/php/5.6/conf.d/mcrypt.ini /etc/php/5.6/mods-available/mcrypt.ini
sudo phpenmod mcrypt
sudo service php5.6-fpm restart
But I still get the same message in the browser.
What step have I missed?
With homestead v9 you should be up and running with php5.6 out of the box as stated in
here, but unfortunately it is not your case, and I understand that...
Old packages were not installed by default (php5.6-mcrypt), as you mentioned and they should be added by hand via:
sudo apt-get install php5.6-mcrypt
After that all packages are ready, up and working, especially php5.6-mcrypt.
The root of your problem is in multiple site definitions under your homestead.yaml.
Most probably some of them are overlapping and your nginx is referring to the wrong resource/site_definition, and wrong paths.
Therefore you might think some strange php versions or routes are run/executed.
You can verify that, by deleting some/all of them, leaving the only one important for you - in (/etc/nginx/sites-enabled/...).
Of course please do that inside the container and issue sudo service nginx restart, afterwards...
All of your problems should be gone after that.
If something goes wrong. You could easily recover your current installation to current state using vagrant destroy and vagrant up afterwards, cause all is saved in Homestead.yaml.
In my installation Homestead v9 is running with php5.6 on laravel 4.1 without any problems...
Hope it helps #jsm...
Because all the PHP versions installed on homestead you need to set the PHP version for a site in the Homestead.yaml.
First check what version the server is running with phpinfo();
Check the file /etc/nginx/sites-enabled/homestead.test and look for this line:
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
If you didn't set the php version on the sites list, this file will be pointing to the php7.3.sock.
In this case the version 5.6 has mcrypt installed, but 7.3 don't.
You can just replace the line
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
for
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
and then reload nginx with sudo nginx -s reload.
Or set the php version on Homestead.yaml:
sites:
- map: homestead.test
to: /home/vagrant/code/public
php: "5.6"
And then run vagrant provision, it will change the nginx configuration for PHP 5.6.

Laravel Migration Error :: PDOException, Could not find driver

I am trying to make a laravel and stucked when migration. when i enter php artisan migrate in terminal, showing PDOException error. attaching my screenshot of terminal and phpinfo.
What i sthis issue, How can i solve this,
I am using Xampp.
Anybody please help me.
Thanks
Try re-installing Xampp? You could use Laravel homestead for a virtual machine, it makes sure you have the proper PHP version and the required dependencies needed to install and avoids having to run Xampp or MAMP or WAMP or any of the amps.
It looks like Xampp cannot find: /usr/lib/php5/20121212/php_pdo_mysql.dll, so make sure that file exists.
You may need to re-install PHP PDO on your machine, refer to: http://php.net/manual/en/pdo.installation.php
Also per PHP docs:
PDO and all the major drivers ship with PHP as shared extensions, and
simply need to be activated by editing the php.ini file:
extension=php_pdo.dll
Please check you have installed more than one php version in your system, one is running for web server and another for php CLI, using PHP_INFO for web and php --ini in commandline, if different version found then upgrade or downgrade means make it one version configuration, and make sure PDO is enable in your system.
From php5.6 to php7.0:
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
CLI:
sudo update-alternatives --set php /usr/bin/php7.0
From php7.0 to php5.6:
Apache:
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
CLI:
sudo update-alternatives --set php /usr/bin/php5.6

Can't access localhost/laravel in LAMP

I'm new to Ubuntu 14.04 and I installed LAMP and I install laravel in /var/www but it seems that I can't access localhost/laravel in my server it says.
So what I'm missing here?
Edit:
It works when i try php artisan serve then it gives me localhost:8000 but when localhost/laravel it doesn't work.
It's because of your Apache is not working. You can start your Apache by the following command
sudo service apache2 start
You can see more about start/stop/restart Apache at here.
Or if you want to re install your lamp, so you can see at here

Resources