I have a PHP Laravel project hosted on Heroku with a Postgresql database and I want to add a Wordpress blog to /blog.
I added in the public folder a blog folder and then copied the last version of WordPress there.
After that, I followed, starting with step 6, this tutorial: http://www.merocode.com/hosting-wordpress-blog-on-heroku-with-support-of-postgres/. I also replaced the wp_config variables with the ones provided on Heroku.
After deploying it to Heroku and trying to test my_site.herokuapp.com/blog I get:
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /app/public/blog/wp-content/pg4wp/core.php(32) : eval()'d code on line 1612
Connecting to your PostgreSQL database without a password is considered insecure.
If you want to do it anyway, please set "PG4WP_INSECURE" to true in your "db.php" file.
Can anyone help me with this problem? Do you know another good tutorial with all the steps that can help me host a WordPress blog to an existing PHP Laravel project?
Thank you!
Laravel and Wordpress should be separated!
This error is not related to Laravel. Check your Wordpress files and versions or your webserver config.
Correct solution:
Create a new config in your webserver and define new routes for /blog and separate your project folders.
Related
I have a basic codeIgniter 4 project with no connection to a database. As at now it uses the default config for routing. I have followed the appropriate casing for the Controllers... that is first letter uppercase. The project works fine on local host but returns 404 error on heroku.
404 - File Not Found
Sorry! Cannot seem to find the page you were looking for.
$baseURL is set to the domain
$indexPage is empty
index.php and .htaccess are in the main directory.
Here is a link to the project on github. And here is the project on heroku
Any suggestions on what I should try?
Thanks a lot!
I am developing a website on Laravel (both frontend and backend).
I installed the baklysystems/laravel-chat-messenger extension on my laptop project files, following every single installation step and it works fine. The chat works very well, I just made some style changes. However, when uploaded the files to GoDaddy hosting, I got the following error:
Class 'BaklySystems\LaravelMessenger\LaravelMessengerServiceProvider' not found
(1/1)Error
Class 'BaklySystems\LaravelMessenger\LaravelMessengerServiceProvider' not found
in ProviderRepository.php line 208
Do any of you have any idea why is this happening?
Protip: I just uploaded the new files and made the modifications on the files that already where there, like for example including in providers in my config/app.php the line:
BaklySystems\LaravelMessenger\LaravelMessengerServiceProvider::class,
Thanks in advance
Currently my directory is var/www/
but i have other projects in this directory .for example:
var/www/wordpress/
laravel tell me :
Sorry, the page you are looking for could not be found.
how can change laravel directory to var/www/cms ?
does work another project?
how can do that?
I commented earlier .. But I think to make the comment more clear I am going to go ahead and answer this:
First what you need to do is cd into /var/www/cms
Next you need to create your Laravel application. While in the cms directory, issue your Laravel creation command IE composer create-project laravel/laravel your-project-name. Once it is finished .. You should have a directory in the cms directory named whatever you named your Laravel Project IE var/www/cms/your-project-name.
You then need to point your hosts file (whether Nginx or Apache) to the directory var/www/cms/your-project-name for whatever domain.
I hope this was simplified enough for you, and good luck!
Laravel Valet could be one of the Solution.
You could create seperate Host for your Specific Application at Localhost.
Explained here : https://stackoverflow.com/questions/19425086/alias-hostname-for-localhost
You could Create new Directory and run your Laravel Project there too.
I am absolutely new to laravel. I have an open source laravel application for which I have downloaded the code. I was able to get the home page running using these links:
https://www.rosehosting.com/blog/install-laravel-on-ubuntu-16-04/
https://askubuntu.com/questions/764782/install-laravel-5-on-ubuntu-16-04
http://idroot.net/linux/install-laravel-ubuntu-16-04/
https://www.howtoforge.com/tutorial/install-laravel-on-ubuntu-for-apache/
none of the other webpages are running. I have to manually change the path in the address bar from localhost/public to localhost/public/index.php. Even after this, the webpage that executes, shows no css.If I try to register a user, I get
SQLSTATE[HY000]: General error: 1364 Field 'username' doesn't have a default value
I have referred to the following links in an attempt to solve the issue but no use -
Access denied for user 'root'#'localhost' - Laravel
https://laravel.com/docs/4.2/quick#routing
https://laravel.com/docs/5.1/quickstart#database-migrations
https://laravel.com/docs/5.1/database
I don't have any data in the database as I cannot understand how to import it. My directory structure is
/var/www/laravelApplicaton
-app/
-artisan
-bootstrap/
-composer.json
-composer.lock
-config/
-database/
-gulpfile.js
-package.json
-phpunit.xml
-public/
-readme.md
-resources/
-routes/
-server.php
-storage/
-tests/
-vendor/
I am using ubuntu 16.04 server; Php7.0.
OK, you're using Laravel 5.3 as your folder structure shows. There if you closely look there's no any .env file. Do create that because Laravel first seeks for .env file for configurations if that doesn't exists, then it looks for key value pairs in configuration folder i.e config. So if you have got .env file do change database information there or you can change that from /config/database.php. But the good practice is to use .env file on development machine. It's shown here in this link, the way to create .env file:
https://www.rosehosting.com/blog/install-laravel-on-ubuntu-16-04/
And for "username doesn't have a default value" issue, you have not passed value for "username" while inserting, this problem arises if you have username field that can't be null in your database structure.
The best option to play with Laravel is to use composer. Please follow the laravel 5.3 documentation for installation process.
https://laravel.com/docs/5.3/installation
And for beginner Laracast.com have very nice series to get started with Laravel from scratch, I myself have used this tutorial series to get started with laravel.
https://laracasts.com/series/laravel-5-from-scratch/episodes/1
Do check all those episodes out, once you finish you'll be now very much familiar with Laravel.
Hope this helps you.
I've deployed a sample Opencart2.0 under a subdirectory in my godaddy domain. I've created a OCMod xml file remove_unused_desc_from_category.ocmod.xml which removes a line from <sub_dir>/catalog/view/theme/default/template/product/category.tpl
I've installed this using Extension Installer and refreshed the cache. Then checked the new file <sub_dir>/system/modification/catalog/view/theme/default/template/product/category.tpl which had the change.
But it is still not affecting the UI. I'm still a learner of opencart and OCMod. Kindly help.
I have asked the same question in Opencart github repo here, and found the solution.
If you installed opencart with an autoinstaller it migth have added DIR_CATALOG to your root config.php, you must edit it and remove it, it should not be there.And move its value directly to DIR_APPLICATION. - florinsith
Code:
//define('DIR_CATALOG', '/home/<user_dir>/public_html/<sub_dir>/catalog/');
//define('DIR_APPLICATION', DIR_CATALOG);
define('DIR_APPLICATION', '/home/<user_dir>/public_html/<sub_dir>/catalog/');