Custom module gives error in Magento2 - magento

I created a simple custom module in Magento2. I enabled my module in app/etc/config.php, executed the command bin/magento setup:upgrade in my project root folder and cleared all the cache directories.
But after page refresh, I'm getting the below error page:

Check your module version in two files:
app/code/Eglobe/HelloWorld/etc/module.xml
app/code/Eglobe/HelloWorld/composer.json
and make sure they are the same

Related

I am getting 404 error for css and js files after I installed magento

I installed magento 2.4.2 on bluehost vps hosting, but I am getting the website as shown in figure 1 I tried every solution I found online but non of them worked for me.
Solutions I tried:
1- changing the permission for pub/static dir.
2- In app/etc/di.xml, find the virtualType name=”developerMaterialization” section and its item called name=”view_preprocessed”. I changed Symlink with Copy in Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink.
3- php bin/magento setup:static-content:deploy -f command
4- RewriteEngine On, in /pub/static/.htaccess file
5- set sign static files to No (dev/static/sign to 0)
I wish someone can help
Hi #Silverwolf96 and welcome on StackOverflow.
There are few things you can try/check.
1.) Check in the page source if the URLs to your files are correct. If not set correctly, set them manually as described in step 2.
2.) Go to Store > Configuration > General > Web and set under Base URLs & Base URLs (Secure) your URLs for static files - you can set this URL manually and it needs to be set as http://www.example.com/static/
3.) You can try to remove pub/static/frontend on the server
4.) Check what happens if you select Magento Luma as the default theme

Magento 2 Installation, 404 Files

After the installation of Magento 2 I get some errors. I share the screenshot of the error below. The error is exactly.
Error: Magento is first installed with version folder. Example: pub/static/versionxxxxxxx/
A sample url address;
https://furnitica.com/pub/static/version1547110740/frontend/Magento/luma/en_US/requirejs/require.js
But if we make changes to this url ( I will delete version folder url )
https://furnitica.com/pub/static/frontend/Magento/luma/en_US/css/styles-m.css
This works smoothly. Worked when I moved the files to the version folder. But this is not a valid solution because the name of the version folder changes continuously.
Screenshot:
Magento shows 404 for static content if system is in production mode and static content is not deployed. Deploy static content to resolve it:
php bin/magento setup:static-content:deploy

View [layouts.app] not found in laravel

I have created an application in laravel using appzcoder crud-generator plug-in. i have done everything accordingly but i am getting the above mentioned error. I have a folder named layouts in views folder and this folder has app.stub in it. but when i run the project it gives the following error
View [layouts.app] not found. (View:C:\wamp64\www\myProject\resources\views\admin\items\index.blade.php)
make sure you have run below code if not run it will create layout.app path
or manually create view/layout/app.php
php artisan vendor:publish --provider="Appzcoder\CrudGenerator\CrudGeneratorServiceProvider"

Laravel TypiCMS redirects to root

I am using TypiCMS Laravel here : github.com/TypiCMS/Base and I am facing the following problem:
I created a new module named "News" by executing command: composer require typicms/news. I also added providers in config/app.php, have publish views and migrations and migrated the database too.
The only problem I am facing is that whenever the url I given, it redirects me to the root directory of my project, that is, http://localhost/mywebsite/public/
Even, if I give invalid route like localhost/mywebsite/public/foobar, instead of showing me error, it again redirects to the root directory.
I have checked the .htaccess and routes.php file and there is not modifications.
Regards:
Adnan
TypiCMS cannot be installed in a subfolder, the root of your site must be http://localhost.

How to disable custom module in magento

I have overridden core file in my custom module extension.
Disabling this module using magento admin panel is not working.
system -> configuration -> Advanced
Module Name (drop down option - disable)
Thanks in advance.
When we disable module from admin, it only disables html output on frontend.
Module config file still loads when module is disable from admin, so your override functionality is still loaded with this module, so try to disable that module from config file.
Try <active>false</active> in your module etc .xml file.
I would prefer to disable the module via terminal
bin/magento module:disable ${MODULE_NAME}
If it says there is no such module, try listing all enabled ones to find yours
bin/magento module:status --enabled
Reference to official dosc

Resources