Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Problem creating a PDO Object with Rewriting On

Problem creating a PDO Object with Rewriting On

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
helpphpapachedatabasemysql
3 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike Dev Br
    wrote on last edited by
    #1

    Hi I'm having a weird situation here. I'm trying create a PDO object, like this:

    $dbh = new PDO('mysql:host='.$hostname.';dbname='.$dbname,$username, $password);

    I have rewriting ON in my .htaccess file. when I try to run the script using a URL that will trigger a rewrite rule, it shows me the following error:

    Fatal error: Class 'PDO' not found

    I have a exception rewrite rule for a directory where the script is, named PHP, like this:

    RewriteRule ^(php)($|/) - [L]

    if I run the scripting directly from the directory, it runs normally with no erros. I don't know why this is happening. any clues? Thank you

    M 1 Reply Last reply
    0
    • M Mike Dev Br

      Hi I'm having a weird situation here. I'm trying create a PDO object, like this:

      $dbh = new PDO('mysql:host='.$hostname.';dbname='.$dbname,$username, $password);

      I have rewriting ON in my .htaccess file. when I try to run the script using a URL that will trigger a rewrite rule, it shows me the following error:

      Fatal error: Class 'PDO' not found

      I have a exception rewrite rule for a directory where the script is, named PHP, like this:

      RewriteRule ^(php)($|/) - [L]

      if I run the scripting directly from the directory, it runs normally with no erros. I don't know why this is happening. any clues? Thank you

      M Offline
      M Offline
      Mike Dev Br
      wrote on last edited by
      #2

      just adding some info: the problem can be seen in the following URLs the rewrited one (where the problem occur) www.qualocep.com/dbc/ and the direct file, when it works www.qualocep.com/php/dbc.php I put a phpinfo() the to show more info about the server.

      M 1 Reply Last reply
      0
      • M Mike Dev Br

        just adding some info: the problem can be seen in the following URLs the rewrited one (where the problem occur) www.qualocep.com/dbc/ and the direct file, when it works www.qualocep.com/php/dbc.php I put a phpinfo() the to show more info about the server.

        M Offline
        M Offline
        Mike Dev Br
        wrote on last edited by
        #3

        Solve it. There was an empty php.ini in the public_html, I deleted it, and it worked. thank u all

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups