File Manager for TinyMCE 5 Not showing uploaded images,404 image not found,but it exists in the folder - Laravel - laravel

So,i've been having problems with integrating file manager to TinyMCE 5,uploading images into a specified folder using the file manager works without any issues,that is also true for deleting the images,but the problem is when you try to use the images,they appear as blank and if you open a console you will see error 404 messages that images don't exist

The solution that worked for me is that i went to .env file which is inside of your laravel project and then changed this line of code which is usually located in the first few lines of the file:
APP_URL=http://localhost
to this
APP_URL=http://127.0.0.1:8000
It seems like file manager uses APP_URL to build the URL for some reason,still haven't found out why tho

Related

Laravel App Not Loading CSS From Public Installation Not In public_html

I've installed a pre-made Laravel app and followed the documentation to extract it to the public root except in the documentation they are installing it into public_html, but I have it in a subdomain in a folder named "test" which is on the same level as public_html.
All the CSS and JS should be loading from the public subdirectory, but they try to look for it in the main root folder.
For example, this file returns a 404 error:
https://test.mydomain.com/css/style.css
The file is actually at this location:
https://test.mydomain.com/public/css/style.css
The absolute path of the file is:
/home/mydomain/test/public/css/style.css
Instead of:
/home/mydomain/public_html/public/css/style.css
What environment or config file isn't set correctly and how do I set it to use the correct directory?
UPDATE
Changing the ASSET_URL to "public" fixed the first issue, but now the same thing is happening with the admin.
The app tries to load the dashboard with this URL:
https://test.mydomain.com/admin/dashboard
The page loads all the assets normally when I remove the word "admin" from the URL:
https://test.mydomain.com/dashboard
But this doesn't work for all the pages.
You can try to put public directory path in below given conflagration file.
Config File Path : config/app.php (asset_url)
'asset_url' => env('ASSET_URL', 'https://test.mydomain.com/public/')

Laravel pdf issue: failed to open stream: No such file or directory by using barryvdh/laravel-dompdf package

I am update composer and use barryvdh/laravel-dompdf package.
the problem is when i click the button it show me error like image below:-
Is that anyway to change the folder path? or am I missing code to modify path to download the pdf file?
You need to run this command:
php artisan vendor:publish
Then, try to create a fonts directory in the storage directory.
i.e. storage/app/fonts. Also, remember to make it writable.
For maximum execution time of 30 seconds exceeded, this is not laravel related issue but it's about php configuration issue. Please see this and fix it: http://php.net/manual/en/info.configuration.php#ini.max-execution-time
You can also see this answer: https://stackoverflow.com/a/30290770/6000629
Hope this will helps you!
Try this:
$pdf = PDF::loadView('pdf/personalpdf', compact('user','result'))->setOptions(['defaultFont' => 'sans-serif']);
It worked for me, I didn't make any file/folder
Just remove the reference to css external file in your cart.placeOrder.blade
Note: This directory must exist and be writable by the webserver process.
under the config file thats what it say: therefore you should create the fonts directory inside the storage.
"font_cache" => storage_path('fonts/'),

Laravel. php artisan display return [];

When I use php artisan command, it display "return [];"
Here is a screenshot
Above the header of my web page there is "return []"; too. Does anyone know what this is caused by?
A Laravel configuration file is a PHP file that contains an array, when your application is initialised Laravel loads each configuration file (config/*.php) and adds the array to your configuration.
The problem you're experiencing appears to be due to the fact that your application has a configuration file that is being loaded not as PHP but instead as a text file. This can be caused by a config file missing the opening <?php, which is required for the file to be treated as PHP. For example, if you create a file in config called example.php with the following contents:
return [
];
You would see the behaviour you're experiencing in the screenshot. Therefore you should visit your config directory and identify any file that is missing the opening <?php.

no file uploaded error in magento

I have upgraded my Magento version from 1.4.0.1 to 1.7.0.2.
Now I tried to upload a theme package using upload package file in Magento Connect Manager. It shows an error 'No file was uploaded'.
Please get me a solution.
Try using the Version 2.0 from the dropdown on the extensionpage on magento-connect, that should work.
The No file was uploaded error is return when:
The form key is invalid
$_FILES doesn't exist
$_FILES['file'] is empty
I had the same issue and managed to fix it by commenting out the rewrite instructions in my main .htaccess file in Magento's root folder. Don't forget to add those instructions back after you finished installing your module.
I suggest you keep a .htaccess.magento-connect file for when you want to use Magento Connect along with your regular .htaccess file, and switch between the two.

Installing a CodeIgniter application in a subfolder

I'm trying to install an application made with codeIgniter in a subfolder, so that I can access it using : http://www.domain.com/my_subfolder/
At the root, there's a Wordpress application.
I edited the .htaccess of the Wordpress install to let the request go to the folder /my_subfolder/
It's working fine, the only problem I get is that CodeIgniter is unable to dynamically load the classes in the "libraries" directory. So everything in the CI application works fine until it tries to use an object declared in the "libraries" subfolder, then I get a : Unable to load the requested class: my_class
It doesn't seems that there's a parameter in the "config" folder to change that... any idea?
What you need is to edit your CodeIgniter config.php in System > application > config.
and then edit config.php and set the property:
$config['base_url'] = "http://www.domain.com/my_subfolder/"
Well it seems that the config param base_url should be updated. Also, I used a library with the "MY_" prefix, and I should'nt since I was'nt extending any CI class.
This is 2021. In case anyone is having this same issue with CodeIgniter 4, this is how I solved it when I came across this issue.
Problem
I installed CI in a subfolder in my public_html folder i.e example.com/api. When I visited www.example.com/api, I saw a 403 forbidden error.
Solution
Download and unzip CI on your local machine or use composer.
Rename public folder to the name of your subfolder. In my case, I named it api.
Create another folder and give it any name of choice, for example, let's use mango (yes, I love mangoes). Copy all the remaining files and folders (app, system, writables, env, LICENSE, README, composer, phpunit, spark) into the mango folder. After doing this, we should have 2 folders: api and mango
Copy both folders to your live server cpanel root (Do not copy into public_html or www). Let them be on the same level as public_html
Open api/index.php and change $pathsConfig = FCPATH . '../app/Config/Paths.php'; to $pathsConfig = FCPATH . '../mango/app/Config/Paths.php';
Create a subdomain and point it to /api
Go to the api folder, duplicate the env file and rename it to .env
Open .env and look for app.baseURL=''. Remove the '#' to uncomment that line and the change it to app.baseUrl='http://subdomain' where subdomain is the subdomain you created above e.g http://api.example.com
Open mango/app/config/App.php and look for public $baseUrl and set it to subdomain e.g $baseUrl = 'http://api.example.com'
Your CI project is now well configured. Visit http://api.example.com. and you should see the CodeIgniter welcome page.

Resources