5 Replies Latest reply on Aug 16, 2015 1:23 AM by harveyf45492577

    HTTP 403 error when connecting to MySQL

    peterbata Level 1

      Hello all. I have read a few posts that are similar in nature to the issue that I am having. Before I run off to the Ubuntu discussion forum,  I thought that I would run this by some of the resident gurus. First, my setup.

       

      Running DW CS6 on my laptop. OS = Windows 7 Pro

      Have MySQL, PHP, Apache2 running on Ubuntu Server edition v.12.04.3 LTS Codename precise

      The Ubuntu server is running as a Hyper-V VM in Windows Server 2012

       

      Conecting via FTP to the server and web directory that holds my PHP content functions just as it should.

       

      Connecting to the MySQL database on the other hand is a different story. My database and tables are both setup. And, I can connect to the database via a require connect.php test file that I have written. I use the same credentials in this file and the CS6 database setup.

       

      Here are two screen shots of some results. Any assistance would be greatly appreciated. Thank you. Peter

       

      FTP Success - 25-11-2013 20-25-16 PM.jpg

       

      And the HTTP error 403

       

      Error Code 403 - 25-11-2013 20-26-25 PM.jpg

        • 1. Re: HTTP 403 error when connecting to MySQL
          BenPleysier Adobe Community Professional & MVP

          The 403 Forbidden HTTP status code means that accessing the page or resource you were trying to reach is absolutely forbidden.

           

          In other words, a 403 error means that you don't have access to whatever you're trying to view.

           

          The problem may stem from the fact that PHPMyAdmin is trying to attach to 127.0.0.1 (IPV4 localhost) which is not available in the latest versions of Windows which uses IPV6.

           

          Have a look at the content of phpmyadmin.conf and change from

          <Directory "c:/wamp/apps/phpmyadmin3.4.5/">
              Options Indexes FollowSymLinks MultiViews
              AllowOverride all
                  Order Deny,Allow
              Deny from all
              Allow from 127.0.0.1
          </Directory>

          to

          <Directory "c:/wamp/apps/phpmyadmin3.4.5/">
              Options Indexes FollowSymLinks MultiViews
              AllowOverride all
                  Order Deny,Allow
                  Allow from all
          </Directory>

          or similar.

          1 person found this helpful
          • 2. Re: HTTP 403 error when connecting to MySQL
            peterbata Level 1

            Thank you for the prompt reply Ben. I appreciate it. This is all that my phpmyadmin.conf consists of:

            So, am I to understand from your post that CS6 database setup uses phpmyadmin to communicate with MySQL?

            ______________________________________________________________________________

             

            # phpMyAdmin default Apache configuration

             

            Alias /phpmyadmin /usr/share/phpmyadmin

             

            <Directory /usr/share/phpmyadmin>

                Options FollowSymLinks

                DirectoryIndex index.php

             

                <IfModule mod_php5.c>

                    AddType application/x-httpd-php .php

             

                    php_flag magic_quotes_gpc Off

                    php_flag track_vars On

                    php_flag register_globals Off

                    php_admin_flag allow_url_fopen Off

                    php_value include_path .

                    php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp

                    php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/

                </IfModule>

             

            </Directory>

             

            # Authorize for setup

            <Directory /usr/share/phpmyadmin/setup>

                <IfModule mod_authn_file.c>

                AuthType Basic

                AuthName "phpMyAdmin Setup"

                AuthUserFile /etc/phpmyadmin/htpasswd.setup

                </IfModule>

                Require valid-user

            </Directory>

             

            # Disallow web access to directories that don't need it

            <Directory /usr/share/phpmyadmin/libraries>

                Order Deny,Allow

                Deny from All

            </Directory>

            <Directory /usr/share/phpmyadmin/setup/lib>

                Order Deny,Allow

                Deny from All

            </Directory>

            • 3. Re: HTTP 403 error when connecting to MySQL
              BenPleysier Adobe Community Professional & MVP

              Sorry, I made some incorrect assumptions. I see now that you are connecting to a server for the test site.

               

              What it boils down to is that the Forbidden message is related to permissions.  If you can't change them yourself through a Control Panel, you will probably have to talk to the Server Administrator.

              • 4. Re: HTTP 403 error when connecting to MySQL
                peterbata Level 1

                Administrator? I guess that would be me as Ubuntu server is running as a Hyper-V VM in Windows Server 2012 on a Proliant server that it is running in the next room.

                 

                What I don't understand is why I am able to write and retrieve information from my database through a PHP script. No permission problems there.

                 

                Let me swing over to the Ubuntu forum. I thank you very much for your time and assistance.

                 

                 

                Peter

                • 5. Re: HTTP 403 error when connecting to MySQL
                  harveyf45492577 Level 1

                  Might be a bit late, but for future reference this is a permissions error.

                  To fix, run the following in the linux terminal:

                   

                  sudo chmod 777 /var/www && sudo chmod 777 /var/www/* && sudo chmod 777 /var/www/*/*

                   

                  Then type:

                   

                  sudo chown -hR www-data /var/www


                  That should fix it. If you now get a mysql error 2003, change the "bind address" parameter in /etc/mysql/my.cnf to server ip.

                  nano /etc/mysql/my.cnf


                  +----------------------------------------------------+

                  | #stuff                                                             |

                  | other parameter                                         |

                  | #used instead of skip-networking           |

                  |bind address          =  your server ip         |

                  +----------------------------------------------------+


                  Hope this helps anyone who has this error.


                  1 person found this helpful