How restore my magento store with backups - magento

I have a magento website in a shared-hosting that I didn't develop -- I just use it. The problem is, whoever developed the website put the magento root in a subfolder from my domain public_html/store so for me to access it, I need to write www.mydomain.com.br/store and my website was working. The problem is that I moved my magento root to public_html by following these steps. (link) But it didn't work. So I started a restore backup for replacing my DB for my website, but now my adminpanel doesn't work. When I try to log in, it shows the message:
"Fatal error: Call to a member function getBlockName() on boolean in
/home/f5f7ohcras32/public_html/app/code/core/Mage/Captcha/Block/Captcha.php
on line 43".
Can help me?
I tried these things:
UPDATE core_config_data SET value = 'http://www.yourdomain.com/'
WHERE path = 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://www.yourdomain.com/'
WHERE path = 'web/secure/base_url';
Rename the folder Captcha for Captcha_old,
SELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites' and make it 0
Delete var/cache and var/session
Checked the permissions /var and files like index.php, .htacess

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

How do I access Codeigniter 4 base url on live server?

I uploaded Codeigniter 4 to a shared hosting in a subdirectory.
I can access the installation (the default controller) if I go to http://example.com/ci4/public
but how can I access the default controller if I want to use http://example.com/ci4/
I already added http://example.com/ci4/ in App.php as baseurl. But currenty I'm getting a page not found error.
Try this okay.
I hope it will work
I discovered that when I try to point all my url to public/index.php in my project it return error 404 based on it can't find my controller after rewriting my .htaccess to point to public/index.php in my project root directory.
This is how I solved my problem =>
I move the index.php and the default .htaccess from public directory to my project root directory then I edit the index.php to locate my app directory
E.g
index.php Default find this line
// This is the line that might need to be changed, depending on your folder structure.
$pathsPath = FCPATH . '../app/Config/Paths.php';
Change it to
// This is the line that might need to be changed, depending on your folder structure.
$pathsPath = FCPATH . './app/Config/Paths.php';
I hope this work for you

Could not find Maintenance.flag file in root folder magento

I was trying to install an extension in my magento site which was failed in the middle later i could not get access to my admin neither to my site as it shows this error.
http://prntscr.com/68qc3c
this error should be removed maintenance.flag file but this file is not available in my root folder. Please assist me if there is any other way possible?
Thanks
two possible ways are
1 . you can delete manually both session and cache directory from var directory.
path
magento_root/var/
2. or you can delete all files of that extension and reinstall again.
The maintenance.flag file must still be in your root directory, otherwise Magento would not be displaying the 503 error. The way that this is displayed is a result of the index.php file, around line 66:
$maintenanceFile = 'maintenance.flag';
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
This page cannot even be cached. Re-connect to your FTP server and check for the file in your html directory on the webserver. Alternately, speak with your web hosts & have them remove the file.
As a precaution, you can try deleting your var/cache directory and see if that makes a difference.

How to install or move laravel project on web server

I'm having trouble installing/moving laravel to web server, i downloaded and set laravel on my local linux server but when i moved it to web server ,it shows a blank page.
I uploaded the public folder contents to public_html and other contents outside the public, also i changed the public DIR from paths.php on bootstrap folder as follow: 'public' => __DIR__.'/../public_html/' so what is the exact problem? Please help me with this issue. Is composer a problem? or what?
1) Create a new directory called ‘laravel4′ adjacent to ‘public_html’ so that your remote file structure now looks like this:
[.htpasswds]
[etc]
[laravel4]
[mail]
[public_ftp]
[public_html] etc etc varies depending on server
2) Upload the contents of your local ‘public’ directory to the remote directory ‘public_html’. Note: Be sure not to copy the whole ‘public’ directory, JUST it’s contents.
3) Upload everything else within your local Laravel project to the new remote ‘laravel4′ directory. Check: Now when you view the ‘laravel4′ folder over FTP/SSH/Whatever, you should see all your ‘app’ & ‘bootstrap’ directories along with all the other files and directories, but NOT ‘public’.
4) Edit the remote file ‘public_html/index.php’ and make the following change:
//from:
require __DIR__.'/../bootstrap/autoload.php';
//and
$app = require_once __DIR__.'/../bootstrap/start.php';
//to:
require __DIR__.'/../laravel4/bootstrap/autoload.php';
//and
$app = require_once __DIR__.'/../laravel4/bootstrap/start.php';
5) Edit the remote file ‘laravel4/bootstrap/paths.php’ and make the following change:
//from:
'public' => __DIR__.'/../public',
//to:
'public' => __DIR__.'/../../public_html',
6) That should be it. In my case, that was enough to restructure everything. Routes are working with the default .htaccess file. If you have problems, let me know, or ask on the ever-helpful
Reference: http://myquickfix.co.uk/2013/08/hosting-laravel-4-on-cpanel-type-hosting-public_html/

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