mysql_pconnect disabled?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    mysql_pconnect disabled?

    Hiya,

    Ive spoken to Charlie one of the chat support guys, about this issue. A new client which wants to move across to me has a CMS which he developed.

    It uses pconnect extensively a standard used in dreamweaver. - Although on all the shared servers it appears to be disabled. Speaking to your support guy, he advised it wouldnt be enabled - and was disabled for security reasons?

    Can anyone advise what security problems enabling Pconnect can cause? As googling I cant see anything specific.

    Thanks,

    #2
    Hello Robert,

    Let me make it clear that MySQL's Pconnect function [ pconnect() ] has been disabled on the shared servers for tuning/optimizing the server performance. It has nothing to do with security but for web servers to work properly and distribute the load efficiently. Both of these functions are designed to establish a connection to a MySQL server, but in different ways.

    Persistent connections are links that do not close even when the execution of your script ends & neither mysql_close() will close/end links established by mysql_pconnect(). When you open a connection with mysql_connect(), the connection to the mysql database will be automatically closed when the script terminates. When you open a connection with mysql_pconnect(), the connection will not be closed and will "persist" for future use..thus using up the server resources unnecessarily.

    Persistent connections were designed to have one-to-one mapping to regular connections. That means that you should always be able to replace persistent connections with non-persistent connections [mysql_connect()], and it won't change the way your script behaves. It may change the efficiency of the script, but not its behavior..There are no major changes that need to be done within your scripts, just remove the "P" in the pconnect() rest everything will work fine.
    Do let us know if you have any further questions.
    Rock _a.k.a._ Jack Daniel

    Follow eUKhost on Twitter || Join eUKhost Community on Facebook

    Comment


      #3
      Hello,

      PHP function "mysql_pconnect" when used in php scripts for database connections, it opens a persistent connection to a MySQL server and if we enable it on our shared/reseller servers then, clients can use it to establish MySQL persistent connections to MySQL server which in turn will consume excessive server CPU resources and also overload the MySQL server which finally can affect adversely on the overall performance of MySQL service. That is the only reason we have disabled the function on our shared and reseller hosting servers.

      I would like to suggest you to change all the instances of "mysql_pconnect" with "mysql_connect" for your scripts which will solve your problem/error on your site.
      Regards,
      Victor Pankhurst,
      Support Team.

      Comment


        #4
        Cheers guys, I assumed there was a reason - but obviously I need to advise my client why its been disabled.

        Now you've explained it, thats more than understandable. I will ask the client if its possible to use connect instead of a persistent connection.

        Regards,

        Comment


          #5
          As has been said, it shouldn't affect the functioning of the CMS so I can't see there being a legitimate problem .
          David Smith
          Managing Director
          DPS Computing Limited

          - Massive update! (September 2011) - It's now not neglected!!
          - New Site (10/2009)

          Comment

          Working...
          X