How to upload Laravel Project to subdomain without database? - laravel

I am upload project file to Sub Domain. But In web site,just project files is showing. Project is not execute. How can i resolve this problem ?
Subdomain is active.

Your hosting and configuration should have the ff:
Appropriate PHP version compatible to your Laravel project.
Composer and Laravel installed.
Proper web server configuration for Apache, Nginx, Litespeed, etc. This is most likely where your problem is, where you should only expose the /public folder as the only public directory of your page.

I installed composer and I add .env file the run some commands like
php artisan key:generate
php artisan clear-compiled
php artisan cache:clear
php artisan config:clear
php artisan optimize
php artisan route:cache
Then resolved problem.

Related

Edit some files in resources folder after production in Laravel

I am trying to edit some files (for example change the path of logo file) in resources folder in laravel project. After editing files which needed website is not updated.
I used :
php artisan config:clear
php artisan config:cache
php artisan cache:clear
but nothing helped. changes are not updated. Maybe I need to run some commands from ssh and make edition?

Laravel project pages not showing

I have cloned a laravel project from github and when I try to use it on my localhost, all I see is the homepage, which is fully functional, but has bits of content and images missing. Then if I try to go to any other route I get an error saying The requested URL was not found on this server.
For reference I am using MAMP as the web server, I have checked the httpd file and everything seems okay, anyone got a clue what's going on?
Use these commands in order :
cp .env.example .env
composer install
php artisan key:generate
php artisan migrate:fresh --seed
npm install
npm run dev
php artisan serve

laravel telescope nothing to migrate

i have a laravel 6 app that i want to install the telescope in that i did all the commands like composer update and composer dump-autoload and then i install the telescope every thing is going fine and when i run php artisan telescope:install i get the message below :
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.
but it wont generate the config file and migration so when i run php artisan migrate i get this message :
nothing to migrate
in your command
php artisan vendor:publish --tag=telescope-migrations
then edit you your env file
TELESCOPE_ENABLED=true
after this run
php artisan optimize
Finally
php artisan migrate
You must publish it first using the below command:
php artisan vendor:publish --tag=telescope-migrations
Then you will get the default migrations and also the config/telescope.php file
After installing the telescope in my project and exporting the default migration I got this error.
λ php artisan vendor:publish --tag=telescope-migrations
Unable to locate publishable resources.
Publishing complete.
How I solve this issue
If you're getting this issue open telescope.php file which is inside of your config directory.
and then set the value of this TELESCOPE_ENABLED to true
'enabled' => env('TELESCOPE_ENABLED', true),
Because in my case the value of TELESCOPE_ENABLED this was false
Then again run this command php artisan vendor:publish --tag=telescope-migrations.
I hope it will work :)
I had accidentally ran php artisan optimize in my local environment which was causing this issue. To fix it, I had to run php artisan optimize:clear, then uninstall laravel/telescope, remove any references to it, and install it again from scratch. It then recognised the migrations and the published assets.
I did this
composer remove laravel/telescope
Then change your .env file
TELESCOPE_ENABLED=true
Then install back again it worked!

Moving laravel project to another directory

I just installed laravel. I use Windows Xampp.
Currently I installed it in c:\users\user_name\laravel.
Is that correct or should I put it in htdocs?
If so how to do it?
thanks for your help
Cut paste you laravel project in path to xampp\htdocs . set root folder of xampp to xampp\htdocs\laravel\public
Thanks to syam who helped me to start finding a fix to my problem.
Here is my solution
Move laravel project to htdocs
Change the env configuration DB_DATABASE=your_db_name DB_USERNAME=user_name DB_PASSWORD=user_password
Edit AppServiceProvider.php and add this code
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
Then in command line move the active directory to your laravel project and execute this code
composer install
php artisan key:generate
php artisan cache:clear
php artisan migrate
On moving laravel project to another directory:
To clear cache, sometimes permission problem may occur. Do this serially:
change env values then,
php artisan key:generate
php artisan config:clear
php artisan cache:clear
php artisan migrate

Reload .env constants in Laravel 5.2

I just changed a constant inside my .env file. The new value is shown up correctly with php-cli (via tinker), but not in my web app (php-fpm).
So far I've tried everything as suggested:
sudo service nginx restart
sudo service php7.0-fpm restart
sudo service php7.0-fpm reload
.
php artisan config:cache
This will generate a cache config file in bootstrap/cache/config.php
php artisan config:clear
This will remove cache config file in bootstrap/cache/config.php
php artisan cache:clear
What exactly does does ? What type of cache does it clear?
php artisan clear-compiled
This clear compile classes
composer dump-autoload
This will generate/update composer autoload file.
I have some .env variables that are not part of any config file. So it is useless for me to run any of the artisan commands.
None of the above php artisan commands don't deal directly with $_ENV.
Seems that $_ENV is stored somewhere in the server and laravel cannot update it once properties are populated.
The only solution I've found is restarting the server.
I'm running a Laravel Forge instance.
If it is cached and you need to reload it you can simply use:
php artisan config:clear
This will pull in any changes that you have since made.
Try to delete the config on file on: Bootstrap/cache/config.php
AS well you can try: php artisan config:cache or php artisan cache:clear

Resources