JFolder::create: Path not in open_basedir paths Joomla error - joomla

I am unable to install new components, module, on my live site using Joomla.
I got to know from another post that the problem might be in configuration file which in my case i have:
public $log_path = 'C:\\xampp\\htdocs\\pastrimi/logs';
public $tmp_path = 'C:\\xampp\\htdocs\\pastrimi/tmp';
and I also tried this way with no luck unfortunately:
public $log_path = './logs';
public $tmp_path = './tmp';
and I made the permission to 777 for both folders
how would I make this showing on joomla system information writable these two folders?

You have a set already below path this is called global path.
1) First try with this details.
public $log_path = './logs';
public $tmp_path = './tmp';
If you still got the error then follow the second step
2) Open cpanel and goes to file manager
Left side you will see like below if your directory path in root
/home/Directoryname/public_html/logs
/home/Directoryname/public_html/tmp
If your directory in subdomain then use
/home/Directoryname/public_html/sub domain name/logs
/home/Directoryname/public_html/sub domain name/tmp

Related

How restore my magento store with backups

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

Valet showing files under wrong Url

Currently running into issues on my server with links to files in my Laravel application.
I currently have a images folder in storage/app/public and I linked the storage/app/public folder to public with php artisan storage:link.
Now i have a image.jpg in the images folder.
On my local system while using valet I can see the image with the tow following links:
/images/image.jpg
/storage/images/image.jpg
On my server only the second one works (which I assume is correct as there is no images folder directly in the public-directory.
Problem is, I often run into issues when deploying as customers can't see images online (as the link is not working). This wouldn't be an issue if I could not see images local while testing the UI.
Anyone also has this issue and can lead me to some kind of solution?
The issue is that the LaravelValetDriver has a fallback test; if the file doesn't exist in the public directory then it will check the public storage directory.
You can find that here:
if ($this->isActualFile($storagePath = $sitePath.'/storage/app/public'.$storageUri)) {
return $storagePath;
}
You can prevent this behaviour by creating your own Valet Driver that extends the LaravelValetDriver and overrides the isStaticFile method, e.g:
class NoStorageFallbackLaravelValetDriver extends LaravelValetDriver
{
public function isStaticFile($sitePath, $siteName, $uri)
{
if (file_exists($staticFilePath = $sitePath. '/public' . $uri)
&& is_file($staticFilePath)) {
return $staticFilePath;
}
return false;
}
}
Using the public disk is straight forward and should work without problems out of the box.
The public disk uses the 'local' driver which by default uses the storage/app directory.
The command:
php artisan storage:link
will create a symbolic link 'storage' inside your public folder that links to the non-public folder storage/app/public.
When the link is working, you can use the following command:
Storage::disk('local')->put('public/file.txt', 'Contents');
This will store file.txt to
storage/app/public/file.txt
You won't be accessing the file at storage/app/public.file.txt instead you will be accessing it using the symlink public/storage...
Therefore your saved file will publicly accessible at
public/storage/file.txt
Use the asset helper you can get the location of the file:
echo asset('file.txt');

Where should I install Laravel on a shared hosting server?

I have found many questions about this subject but i really got confused and i want to be carefull about this.
Ok so i installed composer in the below dir :
/home/antonis/composer/composer.phar
Now my accessible "public_html" is at :
/var/www/html/project_name/index.html
So project_name is like public_html i guess.
Where should i run the laravel installation?
Would it work if it was like this :
/home/antonis/laravel/app
/home/antonis/laravel/bootstrap
/home/antonis/laravel/config
/home/antonis/laravel/database
etc
And the public dir (where public files of laravel should be) :
/var/www/html/project_name
If you copy the project to public folder then.. .env is exposed.
All the credentials are exposed
Source code is not secure.
Use sub directory installation for laravel
follow the link
https://laravel-news.com/subfolder-install
You should read the article linked Only the public folder should be in the public webspace. Everything else should be private.
Modify this Lines from Public->index.php to the public_html .
require __DIR__.'/../director name/bootstrap/autoload.php';
$app = require_once __DIR__.'/../your director name/bootstrap/app.php';

remove Laravel 4.2 /public from url

I uploaded my laravel 4.2 project on my shared webhost. now I have to go to mydomain.com/public to see the view . But I dont want ant public folder in my address . I used so many suggested .htaccess files but they didn't work for me.
Does any one know other solutions ? (not using .htaccess file) ... for example any laravel config that can help me...
thanks
Normally you need the htaccess file to point to the public folder. But you can copy the content of the public folder in your root folder and change the app path to it.
Copy your index file in your root folder and add this to your index.php file:
// set the public path to this directory
$app->bind('path.public', function() {
return __DIR__;
});
Here is solution I recently found and worked on my local host (I wish and think this works on shared webhost too). I hope it helps someone if has the same problem :
laravel 4 remove public from the URL
Follow the steps below to achieve this.
Step 1
Move everything from public folder to the root directory
Step 2
Now delete the empty ‘public’ folder.
Step 3
Edit the file bootstrap/paths.php
Find the following line
'public' => __DIR__.'/../public',
and replace it with:
'public' => __DIR__.'/..',
Step 4
Modify index.php in root
Find the following line
require __DIR__.'/../bootstrap/autoload.php';
and replace it with:
require __DIR__.'/bootstrap/autoload.php';
Now in the same file find the following line
$app = require_once __DIR__.'/../bootstrap/start.php';
and replace it with:
$app = require_once __DIR__.'/bootstrap/start.php';
That’s all. Browse to your Laravel installation without public in the URL and make sure it works.

Running Joomla locally from xampp?

I downloaded a Joomla installation from a server and want to run it locally from xampp. I installed the database and modified the configuration.php to match my local settings.
Now when I call the local URL, it tells me that the connection to localhost was interrupted (ERR_CONNECTION_RESET). It finds the local database because when I change the database name in the config file, it tells me it cant find the database.
Do I have to make changes in the database as well, or maybe at some other place to run it locally?
Thanks!
Check the following things when you are migrating Joomla sites.
It seems DB unable to connect you must check DB name and user details.
Make sure configuration.php is writable.
public $dbtype = 'mysqli'; //which dB type you are using
public $host = 'localhost'; // normally keep as it is
public $user = 'user name'; // DB user name
public $password = 'password'; // DB password
public $db = 'db name';//DB name
public $log_path = '/joomla/logs';//log path your local path
public $tmp_path = '/joomla/tmp'; //temp path if its not correct you can't install plugins.

Resources