0

After changing the port from 80 to 8033, only the page is displayed index.php . Previously, the second page of phpmyadmin was displayed. How do I display a page with phpmyadmin?

This is how I changed the port to the apatch:

$ sudo semanage port -l | grep -w http_port_t
http_port_t tcp 80, 443, 488, 8008, 8009, 8443, 8448
$ sudo vim /etc/apache2/sites-enabled/thost.conf
$ cat /etc/apache2/sites-enabled/thost.conf
<VirtualHost *:8033>
...
$ sudo vim /etc/apache2/ports.conf 
$ cat /etc/apache2/ports.conf 
...
Listen 8033
...
$ sudo systemctl restart apache2
$ sudo netstat -tlpn | grep apache
tcp6 0 0 :::8033 :::* LISTEN 2452/apache2 
$ sudo semanage port -a -t http_port_t -p tcp 8033
$ sudo semanage port -l | grep -w http_port_t
http_port_t tcp 8033, 80, 443, 488, 8008, 8009, 8443, 8448
$ sudo ufw allow 8033
$ sudo systemctl restart apache2
$ google-chrome http://192.168.122.98:8033/
asked May 22, 2024 at 6:22

2 Answers 2

0

To ensure that phpMyAdmin is correctly displayed after changing the port, follow these steps:

  1. Check phpMyAdmin Configuration: Ensure that phpMyAdmin is configured to be accessible on the new port. Update the Alias directive in the Apache configuration to reflect the new port.

    $ sudo vim /etc/apache2/conf-available/phpmyadmin.conf

Make sure it looks like this:

 Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
 Options FollowSymLinks
 DirectoryIndex index.php
 AllowOverride All
 Require all granted
</Directory>
  1. Restart Apache: Restart Apache to apply the changes.

    $ sudo systemctl restart apache2

  2. Access phpMyAdmin: Use the updated URL to access phpMyAdmin. If you are using an alias (e.g., /phpmyadmin), append it to the new port URL:

    http://192.168.122.98:8033/phpmyadmin

  3. Check Apache Logs: If phpMyAdmin still doesn't load, check the Apache error logs for any hints:

    $ sudo tail -f /var/log/apache2/error.log

  4. Verify Permissions: Ensure that the phpMyAdmin directory has the correct permissions and ownership.

    $ sudo chown -R www-data:www-data /usr/share/phpmyadmin

    $ sudo chmod -R 755 /usr/share/phpmyadmin

Sign up to request clarification or add additional context in comments.

Comments

0

That's what helped me

$ sudo systemctl restart apache2
$ sudo a2enconf phpmyadmin.conf
$ sudo systemctl reload apache2
$ sudo apt-get install php8.1-mbstring
$ sudo cat /etc/php/8.1/apache2/php.ini | grep extension=
...
;extension=curl
;extension=ffi
...
$ sudo vim /etc/php/8.1/apache2/php.ini
...
;extension=curl
extension=ctype
;extension=ffi
...
$ sudo cat /etc/php/8.1/apache2/php.ini | grep extension=
$ sudo service apache2 restart
answered May 29, 2024 at 10:40

1 Comment

Thank you for contributing to the Stack Overflow community. This may be a correct answer, but it’d be really useful to provide additional explanation of your code so developers can understand your reasoning. This is especially useful for new developers who aren’t as familiar with the syntax or struggling to understand the concepts. Would you kindly edit your answer to include additional details for the benefit of the community?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.