Pimcore: Fresh installation, backend not loading - http-status-code-403

I wanted to try out Pimcore for the first time today. After alot of setup I've managed to install the demo-basic-twig template with composer.
Now I've tried to access the backend via /admin. The first thing I've noticed is that there seems to be no CSS-file loading:
Now I thought whatever might just be a bug or something but when I try to log into the backend with the user I created it just shows a blank page with a loader without anything happening:
My console just returns a bunch of 403-errors:
Failed to load resource: the server responded with a status of 403 (Forbidden) | jquery-3.3.1.min.js:1
Failed to load resource: the server responded with a status of 403 (Forbidden) | icons.css:1
Failed to load resource: the server responded with a status of 403 (Forbidden) | leaflet.css:1
I guess I've did something wrong in my installation?

Seems like assets are not installed. Try: bin/console assets:install.

My issue was fixed by following the commands below (for Windows):
php bin/console pimcore:deployment:classes-rebuild -d -c
php bin/console assets:install web
php bin/console cache:clear
restart xampp.
Best Of Luck!

It looks like you don't have permission to open assets folder. So if you are on linux Machine follow this commands inside your pimcore project directory
sudo chown -R $USER:www-data .
sudo chmod -R 777 .
If you have pimcore <6
php bin/console assets:install --symlink --relative
If you have pimcore >=6
php bin/console assets:install web --symlink --relative
If you are in windows machine
If you have pimcore <6
php bin/console assets:install --symlink --relative
If you have pimcore >=6
php bin/console assets:install web --symlink --relative

Related

Unable to connect to server following phpMyAdmin upgrade from 5.1 to 5.2

Working environment:
OpenSUSE Leap 15.4
MariaDB : mariadb Ver 15.1 Distrib 10.7.7-MariaDB
PHP 8.0.25 (cli) (built: Oct 31 2022 12:00:00) ( NTS )
Based on phpinfo(), PHP ini file is: /etc/php8/cli/php.ini.
phpMyAdmin 5.1 is working well. Installation directory is: /usr/share/phpMyAdmin (default directory created when installing via zypper install phpMyAdmin command).
The "famous" option $cfg['Servers'][$i]['host'] from /etc/phpMyAdmin/config.inc.php file is set to localhost (and it does work!).
I have then upgraded phpMyAdmin version this way:
srv-bla:~ # mv /usr/share/phpMyAdmin /usr/share/phpMyAdmin.old
srv-bla:~ # mkdir /usr/share/phpMyAdmin
srv-bla:~ # wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz
srv-bla:~ # tar -xzf phpMyAdmin-5.2.0-all-languages.tar.gz
srv-bla:~ # mv phpMyAdmin-5.2.0-all-languages/* /usr/share/phpMyAdmin/
I then restart daemons and test the connection:
srv-bla:~ # systemctl restart mysqld mariadb apache2
The connection page is showing right. I then enter my credentials and I get stuck with this bloody message:
Impossible to connect to server.
mysqli::real_connect(): (HY000/2002): No such file or directory
I have wandered for a while on numerous webpages. Many of them suggest to modify the config.inc.php file and to set $cfg['Servers'][$i]['host'] option to 127.0.0.1 instead of localhost. Unfortunately, this does not fix the problem for me...
Am I editing the right config.inc.php file? Actually, I can find only one on the server:
srv-bla:~ # updatedb
srv-bla:~ # locate config.inc.php
/etc/phpMyAdmin/config.inc.php
/etc/phpMyAdmin/config.inc.php.rpmnew
/etc/phpMyAdmin/config.inc.php.rpmsave
Apache logs are not friendly either. Access logs returns 200 codes only, which seems normal to me (the phpMyAdmin webpage is served properly). Error logs are empty...
Mysql logs are empty also (/var/log/mysql/mysqld.log).
Or course, I have check that mysqld service (same as mariadb service) is running.
The socket file from MariaDB point of view is:
srv-bla:~ # mariadb -u root -p
Enter password:
MariaDB [(none)]> \s
[...]
UNIX socket: /var/lib/mysql/mysql.sock
[...]
The php.ini file is configured the same way:
srv-bla:~ # cat /etc/php8/cli/php.ini | grep mysqli.default_socket
mysqli.default_socket = /var/lib/mysql/mysql.sock
To me, there is no socket issue...
You were right #Georg Richter!
Solution for me:
The PHP configuration file returned by php -r 'phpinfo();' command in a terminal is /etc/php8/cli/php.ini.
The PHP configuration file returned by the phpinfo() function called with a URL such as http://myserver.fr/phpinfo.php is /etc/php8/apache2/php.ini.
I modified the line mysqli.default_socket = /var/lib/mysql/mysql.sock in this other configuration file and could call again phpMyAdmin with success. Note that emtying the browser cache was necessary!
Thanks for help, and hope this will help others!

Laravel persistent permissions for php artisan config:cache file creation

I've followed this guide to set permissions for Laravel 9 running on WSL2 through docker. Everything works great, but whenever I run
php artisan config:cache
The /bootstrap/cache/config.php file does not get updated as you would expect.
ls -l returns the following after running config:cache:
-rw-r--r-- 1 www-data www-data 26933 Nov 16 08:10 config.php
The linked guide above sets the folder permissions to -rwxrwxr--, which then gets overrode by the config:cache command.
Is there any way to persist the permissions on this file without having to run chmod every single time I modify the .ENV or config files?
EDIT
After digging around some more, it looks like everything BUT the 'debug' variable is being updated in the bootstrap/cache/config.php file. Manually changing the debug value to true and re-running php artisan config:cache will revert debug back to false. I'm 100% sure my .ENV is set to true, as well as the backup in my config/app.php file. I'm running in the 'local' environment.
How do I get that debug value to persist?
Run
sudo chmod -R 777 /bootstrap/cache/config.php
sudo chmod -R 777 /bootstrap/cache
You can also run
sudo php artisan config:clear
sudo php artisan optimize:clear

Facing issue while uploading the images on magento 2.4.2 Remote area

I am facing an issue in magento 2 while uploading images in magento 2 backend(admin panel). Images are uploading on tmp folder under pub folder but not able to fetch the link on backend admin panel. Its working fine on my local server. Only facing the issue on server that is on remote area with IIS server on it. Any body have solution related to it. Already tried to given permission but did not work.
Are you using any custom modules? Anyway, Try to redeploy static content. Connect server via SSH and goto Magento root directory. Run the following command (I prefer this way.)
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean

Redmine RailsBaseURI

I installed Redmine with this How-To
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_using_Debian_package
ln -s /usr/share/redmine/public /var/www/redmine
chown -R www-data:www-data /var/www/redmine
echo "RailsBaseURI /redmine" > /etc/apache2/sites-available/redmine
a2ensite redmine
/etc/init.d/apache2 reload
/etc/init.d/apache2 restart
But I get following message restarting apache2.
Syntax error on line 1 of /etc/apache2/sites-enabled/redmine:
Invalid command 'RailsBaseURI', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
Best wishes
Partial solved with #favoretti 's advice:
#apt-get install libapache2-mod-passenger
#/etc/init.d/apache2 reload
Reloading web server config: apache2.
Means the errors are gone
I arrived due to googling "Invalid command 'RailsBaseURI'. There wasn't an answer for me here, but I later realized that this error was being caused by passenger not being enabled.
Assuming you have already installed it, you can enable passenger with sudo a2enmod passenger.
You should check passenger configure.
1.whether link passenger.conf and passenger.load in /etc/apache2/mods-enabled
/etc/apache2/mods-enabled# ls passenger.*
passenger.conf
passenger.load
2.check your configure files: passenger.conf/passenger.load
passenger.conf:
<IfModule mod_passenger.c>
PassengerRoot /home/hao/.rvm/gems/ruby-1.9.3-p448#rails4.0/gems/passenger-4.0.14
PassengerDefaultRuby /home/hao/.rvm/wrappers/ruby-1.9.3-p448#rails4.0/ruby
</IfModule>
passenger.load:
LoadModule passenger_module /home/hao/.rvm/gems/ruby-1.9.3-p448#rails4.0/gems/passenger-4.0.14/buildout/apache2/mod_passenger.so
3.whether passenger is runnig, according to official doc
Restart your web server and run:
passenger-memory-stats

WordPress can't install themes

I can't workout how to solve this problem so wordpress would let me upload themes.
I have a fresh copy of Fedora 17 installed on my dev machine.
I then installed mysql using: yum install mysql mysql-server. Next I installed WordPress which also installs apache and php: yum install wordpress
I can go to http://localhost/wordpress and see WordPress working. But when I try tried to install my theme it asked for ftp credentials. I then updated the wp-config.php file and set the FS_METHOD constant to direct. Now it doesn't ask for ftp credentials but it gives me this error:
Could not create directory. /usr/share/wordpress/wp-content/themes/my-theme-name/
httpd service is running under 'apache' user and 'apache' group. The /usr/share/wordpress/ directory is recursively own by 'apache' user and 'apache' group too. I've even set the permissions to 777 (also recursively) and even then I keep getting the same error as above.
How can I solve this problem?
Fedoras SELinux configuration is most probably blocking the attempts of the webserver to write to the disk. To change the settings for your wordpress folder you can run this command (as root):
chcon -R -t httpd_sys_content_rw_t /usr/share/wordpress/wp-content
No need to do chmod 777 to the whole folder, this is a huge security risk. Of course this is for direct filesystem access, you have to disable the ftp access. For ftp access you will have to look up the right SELinux context.
You got the check these lines in your Wp-config.php (aproximatively line 105) :
define('FTP_USER', 'usr');
define('FTP_PASS', 'P#ssw0rd');
define('FTP_HOST', 'url');
You process of web server is running on apache but Wordpress will use the account define in the wp-config.php . So you got to set the group of your user to get access to these files.
Setting permissions 777 is not a solution, you got to care about it.

Resources