file_put_contents with owners file - php

I have some problems with the owners for this file, which owner had necessary ?
Warning: file_put_contents(/home/web/papier.com/ftp/www/wp- content/plugins/menu_css3/less/variables.less) [function.file-put-contents]: failed to open stream: Permission denied in /home/web/papier.com/ftp/www/wp- content/plugins/menu_css3/panel.php on line 234
file_put_contents(WP_PLUGIN_DIR . '/menu_css3/less/variables.less' , $less);
I changed everything for nobody and nogroup, but with root nothing works on the web ?
this is my ls -al
drwxr-xr-x 8 nobody nogroup 4096 Feb 12 03:07 .
drwxr-xr-x 4 nobody nogroup 4096 Feb 12 01:00 ..
drwxr-xr-x 8 nobody nogroup 4096 Feb 12 01:05 .git
-rw-r--r-- 1 nobody nogroup 18 Feb 12 02:31 .gitignore
-rw-r--r-- 1 nobody nogroup 1177 Feb 12 01:00 CONTRIBUTING.md
-rw-r--r-- 1 nobody nogroup 3258 Feb 12 01:00 Gruntfile.js
-rw-r--r-- 1 nobody nogroup 1055 Feb 12 01:00 LICENSE-MIT
-rw-r--r-- 1 nobody nogroup 361 Feb 12 01:00 README.md
drwxr-xr-x 7 nobody nogroup 4096 Feb 12 01:00 assets
drwxr-xr-x 3 nobody nogroup 4096 Feb 12 01:00 bootstrap-tour
-rw-r--r-- 1 nobody nogroup 126 Feb 12 01:00 bower.json
-rwxr-xr-x 1 nobody nogroup 87237 Feb 12 01:00 elements.html
-rw-r--r-- 1 nobody nogroup 144 Feb 12 01:00 info.json
drwxr-xr-x 2 nobody nogroup 4096 Feb 12 01:00 lang
drwxr-xr-x 3 nobody nogroup 4096 Feb 12 01:00 less
-rw-r--r-- 1 nobody nogroup 1663 Feb 12 01:00 nav.php
-rwxr-xr-x 1 nobody nogroup 537 Feb 12 01:00 package.json
-rwxr-xr-x 1 nobody nogroup 95617 Feb 12 03:15 panel.php
-rw-r--r-- 1 nobody nogroup 1613 Feb 12 01:00 readme.txt
-rw-r--r-- 1 nobody nogroup 1158 Feb 12 01:00 uninstall.php
drwxr-xr-x 9 nobody nogroup 4096 Feb 12 01:00 widgets
root#vds1074:/home/web/xavier-artot.com/ftp/www/wp-content/plugins/menu_css3#
Thanks

Change all the parents directory aswell.
If you have symlink, change the symlink origiral directory permission.

Related

Laravel How is the website hosted without the presence of code in local files?

I am curious I have purchased a theme from Theme Forest. I was working on a Laravel project, so I just purchased this theme just to analyse the code and how it was designed. I am new to Laravel. So I thought it would be good to analyse other codes. I have purchased a theme from ThemeForest. But after checking the routes, there are only routes in web.php, so I don't know where the routes are located. I checked everywhere, but they are not located. So I checked resources->views, which only contained 2 files . So I am curious how the website will work when I host it on my hosting server. Why not? I am able to view the code . When I put these files on hosting, it starts with setup, but after setting up, I am still not able to view the code . Is the website code loaded through a server or something like that ? I have also attached a folder structure of that project.
folder structure
web.php
Route::get('/', function () {
if (file_exists(storage_path('installed'))) {
if (!is_null(config('app.front_url'))) {
return redirect(config('app.front_url'));
}
return response()->json('Success');
} else {
Artisan::call('config:clear', []);
\View::addLocation(base_path() . '/Modules/Installer/Views');
\View::addNamespace('theme', base_path() . '/Modules/Installer/Views');
return View::make('theme::welcome');
}
})->name('index');
// Application cache cleared.
Route::get('/cache-clear', function () {
Artisan::call('cache:clear');
return "Application cache cleared!";
});
// Configuration cached.
Route::get('/config-cache', function () {
Artisan::call('config:cache');
return "Configuration cache cleared!<br>Configuration cached successfully!";
});
// phpinfo.
// Route::get('/phpinfo', function() {
// return response()->json([
// 'stuff' => phpinfo()
// ]);
// });
// Schedule run via URL.
// Route::get('schedule/run', function () {
// Artisan::call('schedule:run', [], $outputLog);
// });
// Route::get('/artisan/{cmd}/', function ($cmd) {
// $outputLog = new BufferedOutput;
// pr("php artisan " . $cmd);
// Artisan::call($cmd, [], $outputLog);
// pr($outputLog);
// return "Done!";
// });
// Queue work.
// Route::get('/queue/work', function () {
// $r = Artisan::call('queue:work');
// pr($r);
// return "Done!";
// });
Totals:
Files: 9136
Directories: 2333
Size: 6,97,00,733 bytes
Size on disk: 16,11,16,160 bytes
command ls -lah
total 847K
4.0K drwxr-xr-x 1 ramesh 197121 0 Sep 23 21:55 ./
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:20 ../
1.0K -rw-r--r-- 1 ramesh 197121 228 Feb 4 2020 .editorconfig
4.0K -rw-r--r-- 1 ramesh 197121 1.2K Jun 7 15:51 .env
4.0K -rw-r--r-- 1 ramesh 197121 1.2K May 24 16:17 .env.example
1.0K -rw-r--r-- 1 ramesh 197121 116 Feb 4 2020 .gitattributes
1.0K -rw-r--r-- 1 ramesh 197121 248 Dec 15 2020 .gitignore
1.0K -rw-r--r-- 1 ramesh 197121 408 May 9 18:56 .htaccess
8.0K drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 Modules/
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 app/
4.0K -rwxr-xr-x 1 ramesh 197121 1.7K Feb 4 2020 artisan*
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 bootstrap/
4.0K -rw-r--r-- 1 ramesh 197121 2.2K May 20 15:52 composer.json
240K -rw-r--r-- 1 ramesh 197121 239K Dec 5 2020 composer.lock
4.0K drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 config/
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 database/
352K -rwxr-xr-x 1 ramesh 197121 352K Nov 4 2020 du.exe*
4.0K -rw-r--r-- 1 ramesh 197121 2.3K Jun 3 14:41 index.html
184K -rw-r--r-- 1 ramesh 197121 181K Jun 6 22:27 install.sql
4.0K -rw-r--r-- 1 ramesh 197121 1.2K Apr 10 2020 package.json
4.0K -rw-r--r-- 1 ramesh 197121 1.2K Feb 4 2020 phpunit.xml
4.0K drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 public/
8.0K -rw-r--r-- 1 ramesh 197121 4.1K Feb 4 2020 readme.md
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 resources/
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 routes/
1.0K -rw-r--r-- 1 ramesh 197121 584 Feb 4 2020 server.php
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 storage/
0 drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:10 tests/
8.0K drwxr-xr-x 1 ramesh 197121 0 Sep 23 12:14 vendor/
1.0K -rw-r--r-- 1 ramesh 197121 3 Jun 7 15:52 version.txt
1.0K -rw-r--r-- 1 ramesh 197121 557 Sep 8 2020 webpack.mix.js

Set default PHP version of apache2 to a specific version

Currently the PHP version showing if I call phpinfo() is 8.0.19.
I need to change it to 8.0.15.
I already build 8.0.15 from source and changed the CLI PHP version successfully by using update-alternatives.
php -v
PHP 8.0.15 (cli) (built: Jun 7 2022 10:21:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.15, Copyright (c) Zend Technologies
But phpinfo still shows 8.0.19.
How can I set it to 8.0.15 globally?
I'am using Ubuntu 22.04
/etc/apache2/mods-enabled
lrwxrwxrwx 1 root root 36 Jun 1 14:30 access_compat.load -> ../mods-available/access_compat.load
lrwxrwxrwx 1 root root 28 Jun 1 14:30 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root 28 Jun 1 14:30 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root 33 Jun 1 14:30 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root 33 Jun 1 14:30 authn_core.load -> ../mods-available/authn_core.load
lrwxrwxrwx 1 root root 33 Jun 1 14:30 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root 33 Jun 1 14:30 authz_core.load -> ../mods-available/authz_core.load
lrwxrwxrwx 1 root root 33 Jun 1 14:30 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root 33 Jun 1 14:30 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root 32 Jun 1 14:30 autoindex.conf -> ../mods-available/autoindex.conf
lrwxrwxrwx 1 root root 32 Jun 1 14:30 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root 30 Jun 1 14:30 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root 30 Jun 1 14:30 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root 26 Jun 1 14:30 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root 26 Jun 1 14:30 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root 26 Jun 1 14:30 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root 29 Jun 1 14:30 filter.load -> ../mods-available/filter.load
lrwxrwxrwx 1 root root 27 Jun 1 14:30 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root 27 Jun 1 14:30 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root 34 Jun 1 14:30 mpm_prefork.conf -> ../mods-available/mpm_prefork.conf
lrwxrwxrwx 1 root root 34 Jun 1 14:30 mpm_prefork.load -> ../mods-available/mpm_prefork.load
lrwxrwxrwx 1 root root 34 Jun 1 14:30 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root 34 Jun 1 14:30 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root 29 Jun 7 13:03 php8.0.conf -> ../mods-available/php8.0.conf
lrwxrwxrwx 1 root root 29 Jun 7 13:03 php8.0.load -> ../mods-available/php8.0.load
lrwxrwxrwx 1 root root 33 Jun 1 14:30 reqtimeout.conf -> ../mods-available/reqtimeout.conf
lrwxrwxrwx 1 root root 33 Jun 1 14:30 reqtimeout.load -> ../mods-available/reqtimeout.load
lrwxrwxrwx 1 root root 30 Jun 2 11:42 rewrite.load -> ../mods-available/rewrite.load
lrwxrwxrwx 1 root root 31 Jun 1 14:30 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root 31 Jun 1 14:30 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root 36 Jun 2 08:38 socache_shmcb.load -> ../mods-available/socache_shmcb.load
lrwxrwxrwx 1 root root 26 Jun 2 08:38 ssl.conf -> ../mods-available/ssl.conf
lrwxrwxrwx 1 root root 26 Jun 2 08:38 ssl.load -> ../mods-available/ssl.load
lrwxrwxrwx 1 root root 29 Jun 1 14:30 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root 29 Jun 1 14:30 status.load -> ../mods-available/status.load
/etc/apache2/mods-available
-rw-r--r-- 1 root root 100 Mar 23 02:00 access_compat.load
-rw-r--r-- 1 root root 377 Mar 23 02:00 actions.conf
-rw-r--r-- 1 root root 66 Mar 23 02:00 actions.load
-rw-r--r-- 1 root root 843 Mar 23 02:00 alias.conf
-rw-r--r-- 1 root root 62 Mar 23 02:00 alias.load
-rw-r--r-- 1 root root 76 Mar 23 02:00 allowmethods.load
-rw-r--r-- 1 root root 76 Mar 23 02:00 asis.load
-rw-r--r-- 1 root root 94 Mar 23 02:00 auth_basic.load
-rw-r--r-- 1 root root 96 Mar 23 02:00 auth_digest.load
-rw-r--r-- 1 root root 100 Mar 23 02:00 auth_form.load
-rw-r--r-- 1 root root 72 Mar 23 02:00 authn_anon.load
-rw-r--r-- 1 root root 72 Mar 23 02:00 authn_core.load
-rw-r--r-- 1 root root 85 Mar 23 02:00 authn_dbd.load
-rw-r--r-- 1 root root 70 Mar 23 02:00 authn_dbm.load
-rw-r--r-- 1 root root 72 Mar 23 02:00 authn_file.load
-rw-r--r-- 1 root root 78 Mar 23 02:00 authn_socache.load
-rw-r--r-- 1 root root 74 Mar 23 02:00 authnz_fcgi.load
-rw-r--r-- 1 root root 90 Mar 23 02:00 authnz_ldap.load
-rw-r--r-- 1 root root 72 Mar 23 02:00 authz_core.load
-rw-r--r-- 1 root root 96 Mar 23 02:00 authz_dbd.load
-rw-r--r-- 1 root root 92 Mar 23 02:00 authz_dbm.load
-rw-r--r-- 1 root root 104 Mar 23 02:00 authz_groupfile.load
-rw-r--r-- 1 root root 94 Mar 23 02:00 authz_host.load
-rw-r--r-- 1 root root 74 Mar 23 02:00 authz_owner.load
-rw-r--r-- 1 root root 94 Mar 23 02:00 authz_user.load
-rw-r--r-- 1 root root 3.3K Mar 23 02:00 autoindex.conf
-rw-r--r-- 1 root root 70 Mar 23 02:00 autoindex.load
-rw-r--r-- 1 root root 64 Mar 23 02:00 brotli.load
-rw-r--r-- 1 root root 64 Mar 23 02:00 buffer.load
-rw-r--r-- 1 root root 62 Mar 23 02:00 cache.load
-rw-r--r-- 1 root root 889 Mar 23 02:00 cache_disk.conf
-rw-r--r-- 1 root root 89 Mar 23 02:00 cache_disk.load
-rw-r--r-- 1 root root 95 Mar 23 02:00 cache_socache.load
-rw-r--r-- 1 root root 70 Mar 23 02:00 cern_meta.load
-rw-r--r-- 1 root root 58 Mar 23 02:00 cgi.load
-rw-r--r-- 1 root root 115 Mar 23 02:00 cgid.conf
-rw-r--r-- 1 root root 60 Mar 23 02:00 cgid.load
-rw-r--r-- 1 root root 76 Mar 23 02:00 charset_lite.load
-rw-r--r-- 1 root root 60 Mar 23 02:00 data.load
-rw-r--r-- 1 root root 93 Mar 23 02:00 dav.load
-rw-r--r-- 1 root root 83 Mar 23 02:00 dav_fs.conf
-rw-r--r-- 1 root root 79 Mar 23 02:00 dav_fs.load
-rw-r--r-- 1 root root 68 Mar 23 02:00 dav_lock.load
-rw-r--r-- 1 root root 58 Mar 23 02:00 dbd.load
-rw-r--r-- 1 root root 460 Mar 23 02:00 deflate.conf
-rw-r--r-- 1 root root 84 Mar 23 02:00 deflate.load
-rw-r--r-- 1 root root 64 Mar 23 02:00 dialup.load
-rw-r--r-- 1 root root 157 Mar 23 02:00 dir.conf
-rw-r--r-- 1 root root 58 Mar 23 02:00 dir.load
-rw-r--r-- 1 root root 64 Mar 23 02:00 dump_io.load
-rw-r--r-- 1 root root 60 Mar 23 02:00 echo.load
-rw-r--r-- 1 root root 58 Mar 23 02:00 env.load
-rw-r--r-- 1 root root 66 Mar 23 02:00 expires.load
-rw-r--r-- 1 root root 72 Mar 23 02:00 ext_filter.load
-rw-r--r-- 1 root root 89 Mar 23 02:00 file_cache.load
-rw-r--r-- 1 root root 64 Mar 23 02:00 filter.load
-rw-r--r-- 1 root root 66 Mar 23 02:00 headers.load
-rw-r--r-- 1 root root 176 Mar 23 02:00 heartbeat.load
-rw-r--r-- 1 root root 182 Mar 23 02:00 heartmonitor.load
-rw-r--r-- 1 root root 1.3K Mar 23 02:00 http2.conf
-rw-r--r-- 1 root root 62 Mar 23 02:00 http2.load
-rw-r--r-- 1 root root 62 Mar 23 02:00 ident.load
-rw-r--r-- 1 root root 68 Mar 23 02:00 imagemap.load
-rw-r--r-- 1 root root 82 Mar 23 02:00 include.load
-rw-r--r-- 1 root root 402 Mar 23 02:00 info.conf
-rw-r--r-- 1 root root 60 Mar 23 02:00 info.load
-rw-r--r-- 1 root root 116 Mar 23 02:00 lbmethod_bybusyness.load
-rw-r--r-- 1 root root 116 Mar 23 02:00 lbmethod_byrequests.load
-rw-r--r-- 1 root root 114 Mar 23 02:00 lbmethod_bytraffic.load
-rw-r--r-- 1 root root 114 Mar 23 02:00 lbmethod_heartbeat.load
-rw-r--r-- 1 root root 121 Mar 23 02:00 ldap.conf
-rw-r--r-- 1 root root 60 Mar 23 02:00 ldap.load
-rw-r--r-- 1 root root 70 Mar 23 02:00 log_debug.load
-rw-r--r-- 1 root root 76 Mar 23 02:00 log_forensic.load
-rw-r--r-- 1 root root 58 Mar 23 02:00 lua.load
-rw-r--r-- 1 root root 62 Mar 23 02:00 macro.load
-rw-r--r-- 1 root root 56 Mar 23 02:00 md.load
-rw-r--r-- 1 root root 7.6K Mar 23 02:00 mime.conf
-rw-r--r-- 1 root root 60 Mar 23 02:00 mime.load
-rw-r--r-- 1 root root 120 Mar 23 02:00 mime_magic.conf
-rw-r--r-- 1 root root 72 Mar 23 02:00 mime_magic.load
-rw-r--r-- 1 root root 668 Mar 23 02:00 mpm_event.conf
-rw-r--r-- 1 root root 106 Mar 23 02:00 mpm_event.load
-rw-r--r-- 1 root root 571 Mar 23 02:00 mpm_prefork.conf
-rw-r--r-- 1 root root 108 Mar 23 02:00 mpm_prefork.load
-rw-r--r-- 1 root root 836 Mar 23 02:00 mpm_worker.conf
-rw-r--r-- 1 root root 107 Mar 23 02:00 mpm_worker.load
-rw-r--r-- 1 root root 724 Mar 23 02:00 negotiation.conf
-rw-r--r-- 1 root root 74 Mar 23 02:00 negotiation.load
-rw-r--r-- 1 root root 855 May 17 18:49 php8.0.conf
-rw-r--r-- 1 root root 101 May 17 18:49 php8.0.load
-rw-r--r-- 1 root root 822 Mar 23 02:00 proxy.conf
-rw-r--r-- 1 root root 62 Mar 23 02:00 proxy.load
-rw-r--r-- 1 root root 87 Mar 23 02:00 proxy_ajp.load
-rw-r--r-- 1 root root 347 Mar 23 02:00 proxy_balancer.conf
-rw-r--r-- 1 root root 115 Mar 23 02:00 proxy_balancer.load
-rw-r--r-- 1 root root 95 Mar 23 02:00 proxy_connect.load
-rw-r--r-- 1 root root 95 Mar 23 02:00 proxy_express.load
-rw-r--r-- 1 root root 89 Mar 23 02:00 proxy_fcgi.load
-rw-r--r-- 1 root root 93 Mar 23 02:00 proxy_fdpass.load
-rw-r--r-- 1 root root 189 Mar 23 02:00 proxy_ftp.conf
-rw-r--r-- 1 root root 87 Mar 23 02:00 proxy_ftp.load
-rw-r--r-- 1 root root 93 Mar 23 02:00 proxy_hcheck.load
-rw-r--r-- 1 root root 2.5K Mar 23 02:00 proxy_html.conf
-rw-r--r-- 1 root root 97 Mar 23 02:00 proxy_html.load
-rw-r--r-- 1 root root 89 Mar 23 02:00 proxy_http.load
-rw-r--r-- 1 root root 97 Mar 23 02:00 proxy_http2.load
-rw-r--r-- 1 root root 89 Mar 23 02:00 proxy_scgi.load
-rw-r--r-- 1 root root 91 Mar 23 02:00 proxy_uwsgi.load
-rw-r--r-- 1 root root 97 Mar 23 02:00 proxy_wstunnel.load
-rw-r--r-- 1 root root 85 Mar 23 02:00 ratelimit.load
-rw-r--r-- 1 root root 70 Mar 23 02:00 reflector.load
-rw-r--r-- 1 root root 68 Mar 23 02:00 remoteip.load
-rw-r--r-- 1 root root 1.2K Mar 23 02:00 reqtimeout.conf
-rw-r--r-- 1 root root 72 Mar 23 02:00 reqtimeout.load
-rw-r--r-- 1 root root 66 Mar 23 02:00 request.load
-rw-r--r-- 1 root root 66 Mar 23 02:00 rewrite.load
-rw-r--r-- 1 root root 58 Mar 23 02:00 sed.load
-rw-r--r-- 1 root root 66 Mar 23 02:00 session.load
-rw-r--r-- 1 root root 99 Mar 23 02:00 session_cookie.load
-rw-r--r-- 1 root root 99 Mar 23 02:00 session_crypto.load
-rw-r--r-- 1 root root 93 Mar 23 02:00 session_dbd.load
-rw-r--r-- 1 root root 1.3K Mar 23 02:00 setenvif.conf
-rw-r--r-- 1 root root 68 Mar 23 02:00 setenvif.load
-rw-r--r-- 1 root root 78 Mar 23 02:00 slotmem_plain.load
-rw-r--r-- 1 root root 74 Mar 23 02:00 slotmem_shm.load
-rw-r--r-- 1 root root 74 Mar 23 02:00 socache_dbm.load
-rw-r--r-- 1 root root 84 Mar 23 02:00 socache_memcache.load
-rw-r--r-- 1 root root 78 Mar 23 02:00 socache_redis.load
-rw-r--r-- 1 root root 78 Mar 23 02:00 socache_shmcb.load
-rw-r--r-- 1 root root 66 Mar 23 02:00 speling.load
-rw-r--r-- 1 root root 3.1K Mar 23 02:00 ssl.conf
-rw-r--r-- 1 root root 97 Mar 23 02:00 ssl.load
-rw-r--r-- 1 root root 749 Mar 23 02:00 status.conf
-rw-r--r-- 1 root root 64 Mar 23 02:00 status.load
-rw-r--r-- 1 root root 72 Mar 23 02:00 substitute.load
-rw-r--r-- 1 root root 64 Mar 23 02:00 suexec.load
-rw-r--r-- 1 root root 70 Mar 23 02:00 unique_id.load
-rw-r--r-- 1 root root 324 Mar 23 02:00 userdir.conf
-rw-r--r-- 1 root root 66 Mar 23 02:00 userdir.load
-rw-r--r-- 1 root root 70 Mar 23 02:00 usertrack.load
-rw-r--r-- 1 root root 74 Mar 23 02:00 vhost_alias.load
-rw-r--r-- 1 root root 66 Mar 23 02:00 xml2enc.load
Try the following:
sudo a2dismod php8.0.19
sudo a2enmod php8.0.15
It should work, or see this.
Edit:
Considering there's no specific module for 8.0.x version for apache, it seems that you have to purge php, and install only the desired 8.0.15 version, as someone did here. Although that would solve your problem (most likely, not tested), it would remove php8.0.19 from your system, so if you need it for any other thing, you'd have to take that into consideration.

php7.1-mbstring won't be loaded even though it's installed

For some reason, I can install pretty much any PHP extension, except for mbstring. I have installed php7.1.14 via sudo apt-get install php7.1 and then installed all my required extensions with sudo apt-get install php7.1-mysql php7.1-json... etc. I did the same for php7.1-mbstring but for some reason it won't get loaded:
forge#staging:~/test$ php -m
[PHP Modules]
Core
ctype
date
dom
fileinfo
filter
hash
iconv
json
libxml
openssl
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
[Zend Modules]
I've already tried adding extension=mbstring and extension=mbstring.so to my /etc/php/7.1/fpm/php.ini and /etc/php/7.1/cli/php.ini but no succes. mbstring.ini also exists in /etc/php/7.1/mods-available:
forge#staging:~/test$ ls -l /etc/php/7.1/mods-available/
total 200
-rw-r--r-- 1 root root 72 Feb 18 2017 bcmath.ini
-rw-r--r-- 1 root root 66 Feb 9 10:41 bz2.ini
-rw-r--r-- 1 root root 74 Feb 18 2017 calendar.ini
-rw-r--r-- 1 root root 71 Feb 18 2017 ctype.ini
-rw-r--r-- 1 root root 68 Feb 18 2017 curl.ini
-rw-r--r-- 1 root root 66 Feb 9 10:41 dba.ini
-rw-r--r-- 1 root root 66 Feb 18 2017 dom.ini
-rw-r--r-- 1 root root 70 Feb 18 2017 exif.ini
-rw-r--r-- 1 root root 74 Feb 18 2017 fileinfo.ini
-rw-r--r-- 1 root root 69 Feb 18 2017 ftp.ini
-rw-r--r-- 1 root root 64 Feb 18 2017 gd.ini
-rw-r--r-- 1 root root 73 Feb 18 2017 gettext.ini
-rw-r--r-- 1 root root 66 Feb 9 10:41 gmp.ini
-rw-r--r-- 1 root root 71 Feb 18 2017 iconv.ini
-rw-r--r-- 1 root root 364 Dec 19 2016 igbinary.ini
-rw-r--r-- 1 root root 68 Feb 18 2017 imap.ini
-rw-r--r-- 1 root root 68 Feb 18 2017 intl.ini
-rw-r--r-- 1 root root 68 Feb 18 2017 json.ini
-rw-r--r-- 1 root root 68 Feb 9 10:41 ldap.ini
-rw-r--r-- 1 root root 76 Feb 18 2017 mbstring.ini
-rw-r--r-- 1 root root 72 Feb 18 2017 mcrypt.ini
-rw-r--r-- 1 root root 176 Feb 12 2017 memcached.ini
-rw-r--r-- 1 root root 74 Dec 7 2016 msgpack.ini
-rw-r--r-- 1 root root 71 Feb 18 2017 mysqli.ini
-rw-r--r-- 1 root root 72 Feb 18 2017 mysqlnd.ini
-rw-r--r-- 1 root root 79 Feb 18 2017 opcache.ini
-rw-r--r-- 1 root root 69 Feb 18 2017 pdo.ini
-rw-r--r-- 1 root root 74 Feb 18 2017 pdo_mysql.ini
-rw-r--r-- 1 root root 74 Feb 18 2017 pdo_pgsql.ini
-rw-r--r-- 1 root root 77 Feb 18 2017 pdo_sqlite.ini
-rw-r--r-- 1 root root 70 Feb 18 2017 pgsql.ini
-rw-r--r-- 1 root root 70 Feb 18 2017 phar.ini
-rw-r--r-- 1 root root 71 Feb 18 2017 posix.ini
-rw-r--r-- 1 root root 76 Feb 18 2017 readline.ini
-rw-r--r-- 1 root root 71 Feb 18 2017 shmop.ini
-rw-r--r-- 1 root root 72 Feb 18 2017 simplexml.ini
-rw-r--r-- 1 root root 68 Feb 18 2017 soap.ini
-rw-r--r-- 1 root root 73 Feb 18 2017 sockets.ini
-rw-r--r-- 1 root root 74 Feb 18 2017 sqlite3.ini
-rw-r--r-- 1 root root 73 Feb 18 2017 sysvmsg.ini
-rw-r--r-- 1 root root 73 Feb 18 2017 sysvsem.ini
-rw-r--r-- 1 root root 73 Feb 18 2017 sysvshm.ini
-rw-r--r-- 1 root root 68 Feb 9 10:41 tidy.ini
-rw-r--r-- 1 root root 75 Feb 18 2017 tokenizer.ini
-rw-r--r-- 1 root root 67 Feb 18 2017 wddx.ini
-rw-r--r-- 1 root root 66 Feb 18 2017 xml.ini
-rw-r--r-- 1 root root 72 Feb 18 2017 xmlreader.ini
-rw-r--r-- 1 root root 72 Feb 18 2017 xmlwriter.ini
-rw-r--r-- 1 root root 66 Feb 18 2017 xsl.ini
-rw-r--r-- 1 root root 66 Feb 18 2017 zip.ini
What could be the issue here?!

My htaccess is not working properly

Here is my .htaccess content:
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /mtd/index.php?page=$1 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /mtd/index.php?page=$1&destination=$2&package=$3 [L]
The following link works correctly:
http://localhost/mtd/our-company.html [Rewrite Rule 1]
The page successfully passes the $_GET values index.php?page=page-name
Yet, the following link is Showing 404 Error
http://localhost/mtd/tours/nepal/index.html [Rewrite Rule 2]
This URL should pass $_GET values like:
index.php?page=tours&destination=nepal&package=index
This was working on Windows 8.1 with XAMPP Server and Remote Server with cPanel, but after I shifted to Ubuntu (Latest) with LAMP Stack, it is no longer working.
after executing command ls -al
root#Neeraz:/var/www/mtd# ls -al
total 1740
drwxr-xr-x 15 neeraz root 4096 Jan 28 13:54 .
drwxrwxrwx 70 root root 4096 Jan 30 14:40 ..
drwxrwxrwx 10 root root 4096 Dec 17 15:56 admin
-rwxrwxrwx 1 root root 15992 Oct 23 12:25 ahome.html
-rwxrwxrwx 1 root root 3226 Nov 24 14:23 booknow.php
drwxrwxrwx 3 root root 4096 Jan 6 22:45 css
-rwxrwxrwx 1 root root 621280 Aug 15 15:56 delight-mockup.jpg
-rwxrwxrwx 1 root root 2531 Dec 10 17:47 find.php
-rwxrwxrwx 1 root root 1544 Nov 24 15:20 HandleTour.php
-rwxrwxrwx 1 root root 346 Feb 3 10:28 .htaccess
drwxrwxrwx 3 root root 4096 Jan 5 15:54 images
drwxrwxrwx 2 root root 4096 Oct 24 18:59 img
-rwxrwxrwx 1 root root 12098 Dec 16 14:00 index1.php
-rwxrwxrwx 1 root root 12372 Jan 29 06:20 index.php
drwxrwxrwx 2 root root 4096 Dec 23 15:15 jquery
drwxrwxrwx 3 root root 4096 Jan 28 13:58 Libs
-rwxrwxrwx 1 root root 13156 Jan 28 14:13 MainPage.php
-rwxrwxrwx 1 root root 1211 Jan 5 22:29 menu0.php
-rw-rw-r-- 1 neeraz neeraz 642 Jan 28 13:57 menulayout.php
-rwxrwxrwx 1 root root 476327 Aug 16 16:08 mt-delight1.jpg
-rwxrwxrwx 1 root root 474429 Aug 16 16:07 mt-delight.jpg
drwxrwxr-x 3 neeraz neeraz 4096 Jan 28 11:35 nbproject
-rwxrwxrwx 1 root root 9892 Sep 19 10:46 nepal.html
drwxrwxrwx 2 root root 4096 Jan 7 00:27 _notes
-rwxrwxrwx 1 root root 684 Oct 25 09:00 PagesLoader.php
-rwxrwxrwx 1 root root 1189 Nov 21 00:00 pie.php
drwxrwxrwx 2 root root 4096 Oct 29 18:16 SpryAssets
-rwxrwxrwx 1 root root 45 Dec 17 16:02 test.php
drwxrwxrwx 2 root root 4096 Dec 29 14:19 TourGallery
-rwxrwxrwx 1 root root 9266 Sep 5 13:29 tour.html
-rwxrwxrwx 1 root root 18333 Jan 5 14:05 tours.php
drwxrwxrwx 2 root root 4096 Oct 27 16:18 TrekkingMap
drwxrwxrwx 3 root root 4096 Dec 29 14:19 uploaded
drwxrwxrwx 2 root root 4096 Dec 15 19:39 uploads
root#Neeraz:/var/www/mtd#
You need correct RewriteBase and make to place this rule in /mtd/.htaccess:
RewriteEngine On
RewriteBase /mtd/
RewriteRule ^([^/]+)/([^/]+)/([^/.]+)\.html$ index.php?page=$1&destination=$2&package=$3 [L,QSA]
RewriteRule ^([^/.]+)\.html$ index.php?page=$1 [L,QSA]

PHP can't read file on /var/tmp

I have a really strange error. PHP can't read a file that do exists... Some ideas? I have not SELinux installed. I'm using fedora 17 and php 5.4.
I already try everything I know, but the problem still remains.
[root#sqd var]# ls -lia
total 92
8194 drwxrwxrwx. 23 root root 4096 ago 17 10:30 .
2 dr-xr-xr-x. 19 root root 4096 ago 13 16:00 ..
32139 drwxr-xr-x. 2 root root 4096 may 22 13:42 account
288 drwxr-xr-x. 2 root root 4096 feb 3 2012 adm
13 drwxr-xr-x. 14 root root 4096 ago 8 10:26 cache
796005 drwxr-xr-x 2 root root 4096 feb 6 2012 cvs
289 drwxr-xr-x. 3 root root 4096 ago 21 18:07 db
290 drwxr-xr-x. 3 root root 4096 may 22 13:42 empty
263682 drwxr-xr-x. 3 root root 4096 ago 7 11:15 ftp
291 drwxr-xr-x. 2 root root 4096 feb 3 2012 games
35931 drwxrwx--T. 2 root gdm 4096 jun 8 16:05 gdm
292 drwxr-xr-x. 2 root root 4096 feb 3 2012 gopher
15 drwxr-xr-x. 45 root root 4096 ago 10 10:42 lib
296 drwxr-xr-x. 2 root root 4096 feb 3 2012 local
308 lrwxrwxrwx. 1 root root 11 may 22 13:39 lock -> ../run/lock
12 drwxr-xr-x. 14 root root 4096 ago 26 03:17 log
297 lrwxrwxrwx. 1 root root 10 may 22 13:39 mail -> spool/mail
298 drwxr-xr-x. 2 root root 4096 feb 3 2012 nis
931987 drwxrwxrwx 3 nobody nobody 4096 ago 17 10:32 nodejs
299 drwxr-xr-x. 2 root root 4096 feb 3 2012 opt
300 drwxr-xr-x. 2 root root 4096 feb 3 2012 preserve
307 lrwxrwxrwx. 1 root root 6 may 22 13:39 run -> ../run
301 drwxr-xr-x. 15 root root 4096 may 22 13:43 spool
305 drwxrwxrwx. 5 nobody nobody 4096 ago 30 14:13 tmp
262637 drwxr-xr-x. 7 root root 4096 ago 7 11:20 www
306 drwxr-xr-x. 2 root root 4096 feb 3 2012 yp
[root#sqd var]# ls -lia tmp/
total 216
305 drwxrwxrwx. 5 nobody nobody 4096 ago 30 14:13 .
8194 drwxrwxrwx. 23 root root 4096 ago 17 10:30 ..
3030 -rwxrwxrwx 1 nobody nobody 199397 ago 30 14:13 file_thumb_5363_1_0.jpg
But
<?php
highlight_file(__FILE__);
var_dump(file_exists('/var/tmp/file_thumb_5363_1_0.jpg'));
print out:
bool(false)
Fedora 16 introduced the concept of a "private tmp" /tmp and /var/tmp I would throw my 2 cents on that direction.
From the manual:
2.3.3. Services Private /tmp
A number of services managed by systemd have been modified to make use of its ability to provide them with a
private /tmp directory. Privileged services using /tmp and /var/tmp
have previously been found to be open to being interfered with by
unprivileged users, potentially leading to privilege escalation. Using
private /tmp directories for services prevents this style of exploit.
The directive added to the systemd unit files for the modified
services is:
[Service]
PrivateTmp=true

Categories