PHP MySQL connect error

OK
I get the following error when running my php pages on our
new web server (Windows Server 2003):
Fatal error: Call to undefined function mysql_pconnect() in
c:\Inetpub\wwwroot\jionas_website\Connections\jonas_website.php
on line 9
When I open the file jonas_website.php it indicates the
filename Connection_php_mysql.htm. It is on my local machine in the
programs folder but not on the web server. Should it be?
If I run a phpinfo page it runs fine...actually any php
commands seems to work.
I also get that "unidentified error" when I try to connect to
MYSQL through Dreamweaver MX 2004. I have followed all the
suggestions in the technote for this error. I still get it.
I can connect to the MYSQL server through MYSQLadministrator
so I am not sure what is going on.
Please help.
Darren

Hung Kuen Kung Fu wrote:
> MYSQL is not listed under the phpinfo page. MMM. Not
sure how to enable this in the php.ini so i will have to look.
Remove the semicolon from the beginning of these lines in the
Windows
extensions section:
;extension=php_mbstring.dll
;extension=php_mysql.dll
Also add this line after them:
extension=php_mysqli.dll
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/

Similar Messages

  • New PHP/MySQL Connection extension doesn't  show tables.  What's the next step?

    I'm creating Dreamweaver extensions to work with my CMS.
    Since it is already connecting to the MySQL database I'd like
    Dreamweaver to access the same connection without asking the
    developer for the MySQL credentials again. I have created the HTML
    form, the EDML for the connection script, and the JavaScript to
    stitch it together, and I can successfully create connections. The
    connection script looks good but when I try to expand the tables in
    the database window it doesn't post a request to the server and it
    just shows "None". I have a regular PHP MySQL connection on the
    same site which works fine.
    I feel like I'm missing a required next step which would tell
    it how to enumerate tables. It would be ideal if I could plug into
    the existing PHP MySQL code for this.
    I would really appreciate any help and/or pointers!

    "zymsys" <[email protected]> wrote in
    message
    news:fiuho4$ao8$[email protected]..
    > I'm creating Dreamweaver extensions to work with my CMS.
    Since it is
    > already
    > connecting to the MySQL database I'd like Dreamweaver to
    access the same
    > connection without asking the developer for the MySQL
    credentials again.
    > I
    > have created the HTML form, the EDML for the connection
    script, and the
    > JavaScript to stitch it together, and I can successfully
    create
    > connections.
    > The connection script looks good but when I try to
    expand the tables in
    > the
    > database window it doesn't post a request to the server
    and it just shows
    > "None". I have a regular PHP MySQL connection on the
    same site which
    > works
    > fine.
    > I feel like I'm missing a required next step which would
    tell it how to
    > enumerate tables. It would be ideal if I could plug into
    the existing PHP
    > MySQL code for this.
    >
    > I would really appreciate any help and/or pointers!
    Are you using the Database access functions?
    http://livedocs.adobe.com/dreamweaver/8/apiref/07_mmd31.htm
    MMDB.getTables()
    http://livedocs.adobe.com/dreamweaver/8/apiref/07_mmd42.htm
    MMDB.getColumns()
    http://livedocs.adobe.com/dreamweaver/8/apiref/07_mmd34.htm
    Or are your trying to create a new Connection Type for the
    PHP_MySQL_ServerModel or a whole new servermodel alltogether?

  • Can't connect PHP/MySQL 404 error

    Wow, the learning curve is killing me. Yet another challenge. I'm using Dreamweaver CC and this tutorial http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html
    I'm at this step:
    Open comments.php. You must have a PHP page open in the Document window to create a MySQL connection.
    In the Databases panel (choose Window > Databases), click the Plus button on the panel and select MySQL Connection.The MySQL Connection dialog box appears.
    Type connTest as the connection name.
    For the MySQL Server, type localhost.If you are using the MAMP default ports on a Mac, use localhost:8889.
    For the User Name, type phptestuser.
    Type the password you chose for the phptestuser account in the Password field.
    For the Database, type php_test.Note: You don't need to precede the underscore with a backslash here. It was inserted by phpMyAdmin in the previous section (see Figure 20) only because phpMyAdmin uses a query that permits wildcard characters.
    Click Test.Dreamweaver attempts to connect to the database. If the connection fails, do the following:
    Double-check the server name, user name, and password.
    Check the settings for the folder Dreamweaver uses to process dynamic pages (see Specifying a Testing Server for Dreamweaver).
    Verify that the web and MySQL servers are both running.
    Temporarily disable any firewall or security program. If the connection works, you need to configure the security program to permit communication between Dreamweaver and MySQL.
    Click OK. The new connection appears in the Databases panel.
    Expand the connTest connection, and then expand the Tables branch. You'll see the comments table in the database, which you can expand to reveal the details of the table columns (see Figure 23).
    As far as I can tell I have followed this tutorial to the letter.
    As far as I can tell, XAMPP/php mySQL are all running fine, the files are in the correct place and everything should be working. However when I hit test I get a 404 error. (Same error when I hit the select button.)
    The suggested problems on the 404 message are:
    1. There is no testing server running on the server machine.
    Pretty sure the testing server is running. Is there any way to test this, other than to note that xampp is definitely running right now and that I can log into phpMYadmin no problem?
    2. The testing server specified for this site does not map to the http://localhost/php_test/_MMServerScripts/MMHTTPDB.php URL Verify that the URL Prefix maps to the root of the site.
    Ummm...I'm pretty sure I put things where I was told to put them in the tutorial, but I'm lost at this point where I should verify what. A clue here? The files are where they are supposed to be, but maybe I entered something wrong? Except...I'm not sure what that could be or where to find it. Whatever IT is.
    Everything in local files is looking good.
    Thanks for your help!
    PS: Extra points to anyone who figures out how to make copy/pasteable error messages! These buggers are the bane of my life!

    Bgupta, you rock!
    I hope you have copied the "mysql.php" and "MMHTTPDB.php" files from "C:\Users\username\AppData\Roaming\Adobe\Dreamweaver CC\locale\Configuration\Connections\Scripts\PHP_MySQL\_mmDBScripts" to "C:\xampp\htdocs\phptest\_mmServerScripts"
    This was EXACTLY the problem. I checked the tutorial and I couldn't even find where the tutorial said to do this. (If I missed it, let me know where in the tutorial it was, please.)
    Fixed!

  • PHP MySql connection to GoDaddy

    I use DWCS4, PHP, MySQL. I have created a MySql database on my GoDaddy-hosted account and can FTP to it and have transferred tables and data to it. However, when I try to create a database connection in DW, I get the following error message; "Your PHP server does not have the MySQL module loaded or you can’t use the mysql_(p)connect functions."
    I searched for solutions on the web (no answers in this forum), and got several results that said to manually create the connection file such as the following
    <?php//Sample Database Connection Syntax for PHP and MySQL.
    //Connect To Database
    $hostname="your_mysqlserver.secureserver.net";
    $username="your_dbusername";
    $password="your_dbpassword";
    $dbname="your_dbusername";
    $usertable="your_tablename";
    $yourfield = "your_field";
    mysql_connect($hostname,$username, $password) OR DIE ("<html><script language='JavaScript'>
    alert('Unable to connect to database! Please try again later.');
    history.go(-1);</script></html>");
    mysql_select_db($dbname);
    ?>
    Just fill in your password etc, save it as connectdb.php (or whatever), and include it at the top of the files that need to access the database. You could use an if statement to determine whether you were working locally or on GoDaddy.
    I tried that, but it still won't connect. (My regular connection for just transferring files works fine).
    Has anyone out there solved the GoDaddy database connection problem?
    Frank

    Check php_info()to see which connector is enabled.
    It should be either mysql or mysqli.
    Since you are having problems with mysql, try to connect with mysqli connector.
    If that won't solve your problem, email GD about your problem, and ask if any mysql connectors are enabled in your hosting plan.

  • Mysql  connect error

    Hi
    I'm using CS4 DW with all the updates. I can log onto my local mysql database but when I setup for the one on my remote webserver
    I get the following error
    MySql Error 2000
    mysqlind cannot connect to MYSQL4.1 using old authentication
    This seems to be a standard error, is there a fix or am I missing something?
    thanks
    Ian

    hello sir, am isaac from u
    ganda i also wanted to upload an im
    ge in mysql database but i failed until igot on your tutorial about
    Upload images to a MySQL database (PHP)
    and i tried to use it but it seems i wasnet connecting to the server please help and correct this Error. for now am using "localhost" where i need to specify the "pass" and "User" but i don't understand this systax you used here
    please help me
    <?php define ('MAX_FILE_SIZE', 1024 * 50); ?>
    <?php require_once('Connections/testConn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double": 
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; 
          break; 
        case "date": 
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; 
          break; 
        case "defined": 
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; 
          break; 
      return $theValue; 
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "uploadImage")) {
      // make sure it's a genuine file upload
      if (is_uploaded_file($_FILES['image']['tmp_name'])) {
        // replace any spaces in original filename with underscores
        $filename = str_replace(' ', '_', $_FILES['image']['name']);
        // get the MIME type
        $mimetype = $_FILES['image']['type'];
        if ($mimetype == 'image/pjpeg') {
            $mimetype= 'image/jpeg';
        // create an array of permitted MIME types
        $permitted = array('image/gif', 'image/jpeg', 'image/png');
        // upload if file is OK
        if (in_array($mimetype, $permitted)
            && $_FILES['image']['size'] > 0
            && $_FILES['image']['size'] <= MAX_FILE_SIZE) {
          switch ($_FILES['image']['error']) {
            case 0:
              // get the file contents
              $image = file_get_contents($_FILES['image']['tmp_name']);
              // get the width and height
              $size = getimagesize($_FILES['image']['tmp_name']);
              $width = $size[0];
              $height = $size[1]; 
      $insertSQL = sprintf("INSERT INTO iimages (filename, mimetype, caption, image, width, height) VALUES (%s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($filename, "text"),
                           GetSQLValueString($mimetype, "text"),
                           GetSQLValueString($_POST['caption'], "text"),
                           GetSQLValueString($image, "text"),
                           GetSQLValueString($width, "int"),
                           GetSQLValueString($height, "int")); 
      mysql_select_db($database_name, $db_name);
      $Result1 = mysql_query($insertSQL, $db_name) or die(mysql_error());
              if ($Result1) {
                $result = "$filename uploaded successfully.";
              } else {
                $result = "Error uploading $filename. Please try again.";
              break;
            case 3:
            case 6:
            case 7:
            case 8:
              $result = "Error uploading $filename. Please try again.";
              break;
            case 4:
              $result = "You didn't select a file to be uploaded.";
        } else {
          $result = "$filename is either too big or not an image.";
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>File upload to database</title>
    </head> 
    <body>
    <?php
    // if the form has been submitted, display result
    if (isset($result)) {
      echo "<p><strong>$result</strong></p>";
    ?>
    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="uploadImage" id="uploadImage">
        <p>
            <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MAX_FILE_SIZE; ?>" />
            <label for="image">Upload image:</label>
            <input type="file" name="image" id="image" />
        </p>
        <p>
          <label for="caption">Caption:</label>
          <input type="text" name="caption" id="caption" />
        </p>
        <p>
            <input type="submit" name="upload" id="upload" value="Upload" />
        </p>
        <input type="hidden" name="MM_insert" value="uploadImage" />
    </form>
    </body>
    </html>

  • PHP/MySQL connection / testing server maybe?

    Problem - I'm unable to connect to a PHP database. I'm
    working right now with tutorials from the DW CS3 Bible by Lowery,
    but haven't been able to connect at all. And I wasted weeks trying
    the same thing with an ASP connection.
    The error message I'm getting now is '405 Method not Allowed'
    when working through the connection dialog. I thought PHP/MySQL was
    supposed to be easier & better than ASP/Access?
    In going through the site setup, instructions for setting up
    the site's testing server say 'click test to verify the connection'
    but there's no button to click. What am I missing?
    Is there some kind of easy test script I can attempt, as with
    asp? Problem there was that I could do the 'timetest' sample, but
    nothing else.
    I have gone through setting permissions and creating IUSR_my
    computer name as a user - they seemd to work fine, but I still
    can't connect.
    Thanks anyone, and everyone - my first post regarding
    connection problems was on 8/22 and I feel like I have gotten
    nowhere.

    Have you looked at this tutorial?
    http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html
    Ken Ford
    Adobe Community Expert Dreamweaver/ColdFusion
    Adobe Certified Expert - Dreamweaver CS3
    Adobe Certified Expert - ColdFusion 8
    Fordwebs, LLC
    http://www.fordwebs.com
    "LReber" <[email protected]> wrote in
    message
    news:gcegd6$qmu$[email protected]..
    > Problem - I'm unable to connect to a PHP database. I'm
    working right now
    > with
    > tutorials from the DW CS3 Bible by Lowery, but haven't
    been able to
    > connect at
    > all. And I wasted weeks trying the same thing with an
    ASP connection.
    > The error message I'm getting now is '405 Method not
    Allowed' when working
    > through the connection dialog. I thought PHP/MySQL was
    supposed to be
    > easier &
    > better than ASP/Access?
    > In going through the site setup, instructions for
    setting up the site's
    > testing server say 'click test to verify the connection'
    but there's no
    > button
    > to click. What am I missing?
    > Is there some kind of easy test script I can attempt, as
    with asp? Problem
    > there was that I could do the 'timetest' sample, but
    nothing else.
    > I have gone through setting permissions and creating
    IUSR_my computer name
    > as
    > a user - they seemd to work fine, but I still can't
    connect.
    > Thanks anyone, and everyone - my first post regarding
    connection problems
    > was
    > on 8/22 and I feel like I have gotten nowhere.
    >

  • Help with php mysql connect script

    Ok guys im new to php mysql and i'm trying to insert some
    form information in my database. Im using a script from sitepoint
    in which i went through the tutorial did some experiments of my own
    and it worked....
    but now i'm getting this error which i cant figure out....
    Error placing order: You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for
    the right syntax to use near 'order SET product ='1',
    size='medium', color='', quantity = '1' at line 1
    here is the page
    http://vaughntucker.com/imagecon/hats.php
    and this is the script
    <?php
    //default page display
    //connect to database
    $dbcnx = @mysql_connect('p3nl41mysql7.secureserver.net',
    'imagecon', 'Dub*boss_1');
    if (!$dbcnx) {
    echo '<p> Unable to connect to the '. 'database server
    at this time.</p>';
    exit();
    //select database
    if (!@mysql_select_db('imagecon')) {
    exit('<p>Unable to locate the ' .
    'database at this time.</p>');
    //Mysql query add joke
    if (isset($_POST['submit'])) {
    $product = 1;
    $size = $_POST['size'];
    $color = $_POST['color'];
    $quan = $_POST['quantity'];
    $sql = "INSERT INTO order SET
    product ='$product',
    size='$size',
    color='$color',
    quantity = '$quan',
    date = CURDATE()";
    }else{
    echo 'No data submited';
    if (@mysql_query($sql)) {
    echo '<p>Your order has been submited.</p>';
    } else {
    echo '<p>Error placing order: ' .
    mysql_error() . '</p>';
    ?>
    thanks in advance

    $sql = "INSERT INTO order SET
    product ='" . $product . "',
    size='" . $size . "',
    color='" . $color . "',
    quantity = '" . $quan . "',
    I believe there are other more elegant ways to do this, as
    well.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "beatzMalone" <[email protected]> wrote in
    message
    news:[email protected]...
    > Ok guys im new to php mysql and i'm trying to insert
    some form information
    > in
    > my database. Im using a script from sitepoint in which i
    went through the
    > tutorial did some experiments of my own and it
    worked....
    >
    > but now i'm getting this error which i cant figure
    out....
    >
    > Error placing order: You have an error in your SQL
    syntax; check the
    > manual
    > that corresponds to your MySQL server version for the
    right syntax to use
    > near
    > 'order SET product ='1', size='medium', color='',
    quantity = '1' at line 1
    >
    > here is the page
    >
    http://vaughntucker.com/imagecon/hats.php
    >
    > and this is the script
    > <?php
    > //default page display
    > //connect to database
    > $dbcnx = @mysql_connect('p3nl41mysql7.secureserver.net',
    'imagecon',
    > 'Dub*boss_1');
    > if (!$dbcnx) {
    > echo '<p> Unable to connect to the '. 'database
    server at this
    > time.</p>';
    > exit();
    >
    > }
    >
    > //select database
    > if (!@mysql_select_db('imagecon')) {
    > exit('<p>Unable to locate the ' .
    > 'database at this time.</p>');
    > }
    >
    > //Mysql query add joke
    > if (isset($_POST['submit'])) {
    > $product = 1;
    > $size = $_POST['size'];
    > $color = $_POST['color'];
    > $quan = $_POST['quantity'];
    > $sql = "INSERT INTO order SET
    > product ='$product',
    > size='$size',
    > color='$color',
    > quantity = '$quan',
    > date = CURDATE()";
    > }else{
    > echo 'No data submited';
    >
    > }
    > if (@mysql_query($sql)) {
    > echo '<p>Your order has been submited.</p>';
    > } else {
    > echo '<p>Error placing order: ' .
    > mysql_error() . '</p>';
    > }
    >
    >
    >
    > ?>
    >
    > thanks in advance
    >

  • Need help with MySQL connection error _mmServerScripts

    Trying to create insert a recordset I got the message:
    "The files from the _mmServerScripts folder are for the server model PHP-MySQL. You try to connect to a database using a different server model .Please remove this folder outside the Dreamweaver environment on both local and testing machines and try again."
    I've searched the net and have seen this message hunting people since dw8...
    I could not find a "cure".
    Things to notice:
    0 - Yes the whole thing is apache/php/mysql... just DW thinks it's not.
    1 - Both the connection and the Recordset actualy works. I have a whole site based on this connection and the recorsets I've created manualy based on it.
    2 - It does not matter if we erase or not the _mmServerScripts folder the message stands still allover.
    3 - The problem seems to show up when you split servers...
    3.1 - If I test in a WAMP environment where apache and mysql are in the same machine I can use DW to create data objects for me.
    3.2 - If I test in my real test environment which have web server and db server separated from each other then I can't use DW to create data objects, see bindings, behaviours etc... all I get is this message.... while the code itself runs fine anyway.
    Does any one already knows how to work around or fix this?
    Thanks,
    Julio

    Thanks PZ,
    Yes everything is fine with the site definition.
    everything works. I can upload, run, test all ok.
    The only thing that does not work is to insert any sort of data object through DW interface. If I declare my reordsets by hands or even If I use the ones DW created in my local test server all works fine.
    Then if I use the site definition and try to see any bindings or create a recordset or create a new connection using dw... then the messages come up and dw can't go any further in that task.
    By spli servers I mean one phisical linux server with apache/php but without mySQL + one physical Linux server with mySQL but without apache/php.
    So when I use a site definition that points either to a WAMP or LAMP i.e. when everything is in the same machine DW goes happy and does whatever it's asked to do.
    When I try that on the real mccoy environment (with the two separated servers)... It looks like DW gets confused...

  • Mysql connections error needing flush

    Connected SQL Developer to a mysql database which worked OK. Used latest mysql connector and added it to prefs.
    Problem is that after awhile SQLDeveloper comes back that mysql has too many connection errors and I should use "mysqladmin flush-hosts". The errors are related to my sqldeveloper as other applicatinos continue to access the db ok.
    I was careful to connect and disconnect in sqldeveloper but this still happens.
    I know I can increase the connection count, etc. in mysql but I'm thinking that just extends any problem.
    Any ideas ? thanks

    Hi Steverar,
    I have got this occasioanly with mysql
    "mysqladmin flush-hosts".
    I ran the command on the mysql test box. I have not investigated it as a SQLDevelloper problem - I thought it was a mysql admin command.
    -Turloch
    SQLDeveloper forum.

  • Php mysql math error when using format(somenumber,2)

    osx 10.5.2, php 5.2.5, mysql 5.0.51 (standard leopard desktop os install)
    Select format(myField,2) as someNumber from myTable ...
    returns data i would expect, formatted as you would expect.
    while looping through the data returned i am calculating a running total.
    for numeric values less than 1,000 results are expected. for numbers gt 1000, php seems to want to truncate the value at the comma. 1,111.11 evaluates to 1; 25,000 evaluates to 25.
    If you remove the format() from the sql statement everything works the way you would expect.
    wrapping the value returned in a floatval() had no effect.
    I am posting this on the apple site rather than php/mysql forums on the off chance that this is a mac centric issue. googling the obvious combinations wasn't productive.

    Sounds like a locale issue.
    Many international formats use comma as the decimal separator, not the thousands.
    There are many levels where this could be set. It could be an OS setting (you don't say where you or, or the locale information of your machine (System Preferences -> International -> Format). It could be in PHP (see: http://www.php.net/setlocale ), or it could be in the database (data could be written in a comma-based table).
    It will take a little research to work out where your specific problem lies.

  • Updating to 10.4.11 killed my PHP/MYSQL connections

    Hi all - I use Dreamweaver CS3 for web development, and have been using some very simple PHP/MYSQL Select and Inserts. Everything was working fabulously up until this morning, when I updated to 10.4.11 (Macbook Pro, CoreDuo). As soon as I updated, I get a 'No Database Selected' message in Safari, Firefox and IE. I can see the database and work with it in DWeaver, just can't get it to go live in browsers.
    I'm running PHP 5.2.4, MYSQL 5.1.8 and whatever version of Apache is bundled in OS X (I think it's 1.x - but can't find how to get that number!)
    Just for record, I have stopped/restarted Personal Web Sharing, Personal File Sharing, OS X, MYSQL to just check whether something wasn't working there.
    I'm about to close out, zap the PRAM and then come back in.
    Any ideas?
    Vince

    Thanks - A couple of additional points. This is OS X 10.4.11, not OS X Server, so I had installed MYSQL and PHP as fresh installations. MYSQL has not changed since I installed and is running fine through direct client (Navicat).
    For PHP I was running 4 and it had been running fine. When the update to OSX came through, PHP 4 didn't work - no change had been made to any configuration file that was working already. These are the httpd.conf instructions I had followed to set-up PHP 4:
    +1 Launch Terminal from /Applications/Utilities.+
    +2 Open the Apache configuration file and edit the UNIX shell prompt:+
    +sudo pico /etc/httpd/httpd.conf+
    +3 When prompted for a password, enter the Mac OS X administrator account password.+
    +4 Uncomment the following lines:+
    +LoadModule php4_module libexec/httpd/libphp4.so+
    +AddModule mod_php4.c+
    +5 Add the following lines (add these lines above: AddType application/x-tar .tgz):+
    +AddType application/x-httpd-php .php+
    +AddType application/x-httpd-php-source .phps+
    +Note: All the commands for the pico editor display on the screen and you can start any commands with the Control key. Use the arrow keys to move around. Pico is a text editor, mostly for UNIX users to use at the UNIX command line. The pico text editor resides in /usr/bin/ directory.+
    +6 Add a new index page for PHP (index.php) so that the web server will recognize it as the first page to load:+
    +<IfModule mod_dir.c>+
    +DirectoryIndex index.html index.php index.htm+
    </IfModule>
    +7 Save the httpd.conf file by pressing ^X (control & x keys). When the screen asks "Save Modified buffer?", press "Y". When prompted for "File Name to write : httpd.conf", press Return once to accept it. This will return you to the UNIX shell prompt.+
    When PHP 4 stopped working, I took the decision to upgrade to 5 and then fix the breakdown (by now, I was convinced it was an Apache change (nothing in config had changed at all). So, upgraded to PHP 5 and, to do so, had to reverse the directions above. Since then, I've tried reenabling the above, replacing with PHP5 wherever PHP4 appears, all to no avail (in fact, it just froze the Personal Web Sharing that turns Apache on/off).
    Right now, running the phpinfo check detailed above tells me the PHP 5 is successfully installed and running. The text from the test copied here:
    +System Darwin Vincet-MacBook-Pro.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386+
    +_Build Date_ Aug 31 2007 23:38:11+
    +_Configure Command_ './configure' '--prefix=/usr/local/php5' '--with-apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-iconv' '--with-openssl=/usr' '--with-zlib=/usr' '--with-gd' '--with-zlib-dir=/usr' '--with-ldap' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-snmp=/usr' '--enable-exif' '--enable-wddx' '--enable-soap' '--enable-sqlite-utf8' '--enable-ftp' '--enable-sockets' '--enable-dbx' '--enable-dbase' '--enable-mbstring' '--enable-calendar' '--enable-bcmath' '--with-bz2=/usr' '--enable-fastcgi' '--enable-cgi' '--enable-memory-limit' '--enable-zip' '--enable-pcntl' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-curl=shared,/usr/local/php5' '--with-mysql=shared,/usr/local/php5' '--with-mysqli=shared,/usr/local/php5/bin/mysql_config' '--with-pdo-mysql=shared,/usr/local/php5' '--with-libxml-dir=shared,/usr/local/php5' '--with-xsl=shared,/usr/local/php5' '--with-pdflib=shared,/usr/local/php5' '--with-imap=../imap-2004g' '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr/local/php5' '--with-png-dir=/usr/local/php5' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local/php5' '--with-iodbc=shared,/usr' '--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--with-t1lib=/usr/local/php5' '--with-gettext=shared,/usr/local/php5' '--with-ming=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/local/php5' '--with-mhash=shared,/usr/local/php5' '--with-mssql=shared,/usr/local/php5' '--with-fbsql=shared,/Users/liyanage/svn/entropy/universalbuild/src/FBDeveloper Libraries/Library/FrontBase' '--with-json=shared' '--enable-memcache' '--enable-openbase_module'+
    +_Server AP_I Apache+
    +_Virtual Directory Suppor_t disabled+
    +_Configuration File (php.ini) Path_ /usr/local/php5/lib+
    +_Loaded Configuration File_ /usr/local/php5/lib/php.ini+
    +_Scan this dir for additional .ini files_ /usr/local/php5/php.d+
    +_additional .ini files parsed_ /usr/local/php5/php.d/10-extension_dir.ini, /usr/local/php5/php.d/50-extension-curl.ini, /usr/local/php5/php.d/50-extension-fbsql.ini, /usr/local/php5/php.d/50-extension-gettext.ini, /usr/local/php5/php.d/50-extension-json.ini, /usr/local/php5/php.d/50-extension-mcrypt.ini, /usr/local/php5/php.d/50-extension-mhash.ini, /usr/local/php5/php.d/50-extension-ming.ini, /usr/local/php5/php.d/50-extension-mssql.ini, /usr/local/php5/php.d/50-extension-mysql.ini, /usr/local/php5/php.d/50-extension-mysqli.ini, /usr/local/php5/php.d/50-extension-odbc.ini, /usr/local/php5/php.d/50-extension-pdf.ini, /usr/local/php5/php.d/50-extension-pdo_mysql.ini, /usr/local/php5/php.d/50-extension-pdo_pgsql.ini, /usr/local/php5/php.d/50-extension-pgsql.ini, /usr/local/php5/php.d/50-extension-xsl.ini+
    +_PHP API_ 20041225+
    +P_HP Extension_ 20060613+
    +_Zend Extension_ 220060519+
    +_Debug Build_ no+
    +_Thread Safety_ disabled+
    +Zend Memory Manager enabled+
    +_IPv6 Support_ enabled+
    +_Registered PHP Streams_ zip, php, file, data, http, ftp, compress.bzip2, compress.zlib, https, ftps+
    +_Registered Stream Socket Transports_ tcp, udp, unix, udg, ssl, sslv3, sslv2, tls+
    +_Registered Stream Filters_ string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, bzip2.*, zlib.*+
    I don't know if any of this helps, but it's what I find. From my online troubleshooting and reading, I believe all of the above looks right and that things should work. So, I'm still left with an informed gut decision that something in the set-up of Apache changed (location in file structure, configuration file, etc.) Could it be looking at a second copy of httpd.conf somewhere else? That would seem to make sense - however I haven't managed to turn up how to assess which version of Apache is loaded (I think 1.3) or where it's located.
    If anyone can confirm what PHP5 code should be included in httpd.conf given the above, that would be a great next step.
    Thanks for all your assistance!
    Vince

  • MySQL + apache2 + PHP Database connection error

    Hi Folks:
    I am trying to connect to the database and keep getting a 500
    internal server error. here is the setup
    Database server -- mysql 4.1 (linux) on a gentoo linux server
    -- IP 192.168.0.10 -- srvdb-01
    Webserver - Apache2 + PHP 5 on Gentoo Linux server
    192.168.0.29 - srvweb-03
    I have all the connections ready to go, dav is moving files
    etc, but when i try to create a database connection, i keep getting
    the following error
    > PROPFIND /_mmServerScripts HTTP/1.1
    > Authorization: Basic dGhvbG1lczp0eXBob29u
    > User-Agent: Contribute/3.0
    > Host: inventory.mcaschool.net
    > Pragma: no-cache
    > Accept: image/gif, image/x-xbitmap, image/jpeg,
    image/pjpeg, */*
    > MIME-Version: 1.0
    > Content-Type: text/xml
    > Content-Length: 134
    > Depth: 0
    > Connection: Keep-Alive
    < HTTP/1.1 500 Internal Server Error
    < Date: Tue, 25 Apr 2006 21:09:54 GMT
    < Server: Apache
    < Content-Length: 607
    < Connection: close
    < Content-Type: text/html; charset=iso-8859-1
    (copied from the DW8 FTP LOG)
    I am really baffled by this problem -- can someone please
    point me in the direction of a solution?
    thanks
    Tim Holmes
    IT MANAGER - Medina Christian Academy

    DJtonyF wrote:
    > ... the issue isnt with godaddy.com the issue is with
    dreamweaver. the "localhost" connection i attemped to connect to
    was one on my own server i setup on my computer.
    How have you set up your Testing Server in the site
    definition?
    If your server root is C:\htdocs, and your site is in
    C:\htdocs\mysite,
    that's the value for "Testing server folder". The URL prefix
    should be
    http://localhost/mysite/.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Voting poll using PHP & MySQL TypeError: Error #2007: Parameter text must be non-null.

    I am getting this back:
    TypeError: Error #2007: Parameter text must be non-null.
    at flash.text::TextField/set text()
    at AS3_Flash_Poll_PHP_MySQL_fla::WholePoll_1/completeHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    PHP code:
    <?php
    // ---------------------------------------- Section 1 -----------------------------------------------
    //  IMPORTANT!!!! Connect to MySQL database here(put your connection data here)
    mysql_connect("ginaty05.fatcowmysql.com","fall2010","@regina") or die (mysql_error());
    mysql_select_db("poll_2010") or die (mysql_error());
    // When Flash requests the totals initially we run this code
    if ($_POST['myRequest'] == "load_numbers") {
    // Query the totals from the database
        $sql1 = mysql_query("SELECT id FROM votingPoll WHERE choice='1'");
        $choice1Count = mysql_num_rows($sql1);
        $sql2 = mysql_query("SELECT id FROM votingPoll WHERE choice='2'");
        $choice2Count = mysql_num_rows($sql2);
        $sql3 = mysql_query("SELECT id FROM votingPoll WHERE choice='3'");
        $choice3Count = mysql_num_rows($sql3);
        echo "choice1Count=$choice1Count";
        echo "&choice2Count=$choice2Count";
        echo "&choice3Count=$choice3Count";
    // ---------------------------------------- Section 2 -----------------------------------------------
    // IF POSTING A USER'S CHOICE
    if ($_POST['myRequest'] == "store_choice") {
        //Obtain user IP address
        $ip = $_SERVER['REMOTE_ADDR'];
        // Create local variable from the Flash ActionScript posted variable
        $userChoice = $_POST['userChoice'];
        $sql = mysql_query("SELECT id FROM votingPoll WHERE ipaddress='$ip'");
        $rowCount = mysql_num_rows($sql);
        if ($rowCount == 1) {
    $my_msg = "You have already voted in this poll.";
    print "return_msg=$my_msg";
        } else {
    $sql_insert = mysql_query("INSERT INTO votingPoll (choice, ipaddress) VALUES('$userChoice','$ip')")  or die (mysql_error());
    $sql1 = mysql_query("SELECT * FROM votingPoll WHERE choice='1'");
    $choice1Count = mysql_num_rows($sql1);
    $sql2 = mysql_query("SELECT * FROM votingPoll WHERE choice='2'");
    $choice2Count = mysql_num_rows($sql2);
    $sql3 = mysql_query("SELECT * FROM votingPoll WHERE choice='3'");
    $choice3Count = mysql_num_rows($sql3);
    $my_msg = "Thanks for voting!";
            echo "return_msg=$my_msg";
            echo "&choice1Count=$choice1Count";
    echo "&choice2Count=$choice2Count";
    echo "&choice3Count=$choice3Count";
    ?>
    AS3 code:
    stop(); // Stop the timeline since it does not need to travel for this to run
    // Assign a variable name for our URLVariables object
    var variables1:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend1:URLRequest = new URLRequest("parse_my_poll.php");
    varSend1.method = URLRequestMethod.POST;
    varSend1.data = variables1;
    // Build the varLoader variable
    var varLoader1:URLLoader = new URLLoader;
    varLoader1.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader1.addEventListener(Event.COMPLETE, completeHandler1);
    // Set variable to send to PHP here for the varloader below
    variables1.myRequest = "load_numbers";  
    // Send data to php file now, and wait for response using the COMPLETE event
    varLoader1.load(varSend1);
    function completeHandler1(event:Event):void{
        count1_txt.text = "" + event.target.data.choice1Count;
        count2_txt.text = "" + event.target.data.choice2Count;
        count3_txt.text = "" + event.target.data.choice3Count;
    // hide the little processing movieclip
    processing_mc.visible = false;
    // Initialize the choiceNum variable that we will use below
    var choiceNum:Number = 0;
    // Set text formatting colors for errors and success messages
    var errorsFormat:TextFormat = new TextFormat();
    errorsFormat.color = 0xFF0000; // bright red
    var successFormat:TextFormat = new TextFormat();
    successFormat.color = 0x00FF00; // bright green
    // Button Click Functions
    function btn1Click(event:MouseEvent):void{
        choiceNum = 1;
        choice_txt.text = choice1_txt.text;
    function btn2Click(event:MouseEvent):void{
        choiceNum = 2;
        choice_txt.text = choice2_txt.text;
    function btn3Click(event:MouseEvent):void{
        choiceNum = 3;
        choice_txt.text = choice3_txt.text;
    // Button Click Listeners
    btn1.addEventListener(MouseEvent.CLICK, btn1Click);
    btn2.addEventListener(MouseEvent.CLICK, btn2Click);
    btn3.addEventListener(MouseEvent.CLICK, btn3Click);
    // Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend:URLRequest = new URLRequest("parse_my_poll.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    // Handler for PHP script completion and return
    function completeHandler(event:Event):void{
        // remove processing movieclip
        processing_mc.visible = false;
        // Clear the form fields
        choice_txt.text = "";
        choiceNum = 0;
        // Load the response from the PHP file
        status_txt.text = event.target.data.return_msg;
        status_txt.setTextFormat(errorsFormat);
        if (event.target.data.return_msg == "Thanks for voting!") {
            // Reload new values into the count texts only if we get a proper response and new values
            status_txt.setTextFormat(successFormat);
            count1_txt.text = "" + event.target.data.choice1Count;
            count2_txt.text = "" + event.target.data.choice2Count;
            count3_txt.text = "" + event.target.data.choice3Count;
    // Add an event listener for the submit button and what function to run
    vote_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    // Validate form fields and send the variables when submit button is clicked
    function ValidateAndSend(event:MouseEvent):void {
        //validate form fields
        if(!choice_txt.length) {  
            // if they forgot to choose before pressing the vote button
            status_txt.text = "Please choose before you press vote.";  
            status_txt.setTextFormat(errorsFormat);
        } else {
            status_txt.text = "Sending...";
            processing_mc.visible = true;
            // Ready the variables for sending
            variables.userChoice = choiceNum;
            variables.myRequest = "store_choice";  
            // Send the data to the php file
            varLoader.load(varSend);
        } // close else after form validation
    } // Close ValidateAndSend function ////////////////////////

    This error means that you are trying to set the text field but there is no data in the variable. As a first step, try to identify where this is happening, eg Is it the first call, or once you have submitted your data or only if you try to submit data second time?
    Trace out the data that is returned for both completeHandlers to see if there is a missing var. Try this for "load_numbers" and "store_choice". Do it twice for "store_choice". Do you get back what you expected?
    You could also try altering the php to return some fixed dummy variables, eg  choice1Count=11&choice2Count=22&choice3Count=33, etc. If this works then you know that the error is in the PHP.
    It looks to me like the issue is when you submit the data a second time and just get back the return_msg - the handler then tries to assign the choice1Count etc but doesn't have any count data back from the poll.php.
    Test that there is data before assigning it, eg
        if(event.target.data.choice1Count){
            count1_txt.text =  event.target.data.choice1Count;
            count2_txt.text =  event.target.data.choice2Count;
            count3_txt.text =  event.target.data.choice3Count;

  • PHP Database Connection Error

    im attempting to a connect to a sql database using php. when
    i create a new connection Dreamweaver always gives me an
    "unexpected error" so it connot connect. the database is mysql 4.1
    (on godaddy.com) and php 5 on the server.
    i attemped to change it to "localhost" on my computer
    thinking it was a godaddy problem but the same issue acures. Im not
    sure what to do

    DJtonyF wrote:
    > ... the issue isnt with godaddy.com the issue is with
    dreamweaver. the "localhost" connection i attemped to connect to
    was one on my own server i setup on my computer.
    How have you set up your Testing Server in the site
    definition?
    If your server root is C:\htdocs, and your site is in
    C:\htdocs\mysite,
    that's the value for "Testing server folder". The URL prefix
    should be
    http://localhost/mysite/.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • MySQL connection error

    Dear Fellow Java Developers:
    I am a junior java developer and I sincerely apologize for my ignorance. I have searched the archives of this forum for advice and information, and for some reason I am not able to get the results I desire.
    I have the following line in my classpath:
    C:\mysql\java\mysql-connector-java-2.0.14-bin.jar;.
    now when I run the following program which I got of the following url:
    http://www.javacoding.net/articles/technical/java-mysql.html?page=1#contentAnchor
    /* import needed for JDBC access */
    import java.sql.*;
    * MySQL Demo Program
    * this program is just a little demonstration of the usage
    * of MySQL in combination with Java JDBC
    * http://www.javacoding.net
    public class TestMySQL {
    public void test ( String host, String database ) throws Exception {
    /* first, we'll test whether the MySQL driver is installed */
    testDriver ( );
    /* then, we'll get a connection to the database */
    Connection con = getConnection ( host, database );
    /* we create a table */
    executeUpdate ( con, "create table test (id int not null,text varchar(20))" );
    /* we insert some data */
    executeUpdate(con,"insert into test (id,text) values (1,'first entry')");
    executeUpdate(con,"insert into test (id,text) values (2,'second entry')");
    executeUpdate(con,"insert into test (id,text) values (3,'third entry')");
    /* then we'll fetch this data */
    executeQuery ( con, "select * from test" );
    /* and we'll destroy the table ... */
    executeUpdate ( con, "drop table test" );
    /* finally, we close the database */
    con.close ( );
    * Checks whether the MySQL JDBC Driver is installed
    protected void testDriver ( ) throws Exception {
    try {
    Class.forName ( "org.gjt.mm.mysql.Driver" );
    System.out.println ( "MySQL Driver Found" );
    } catch ( java.lang.ClassNotFoundException e ) {
    System.out.println("MySQL JDBC Driver not found ... ");
    throw ( e );
    * Returns a connection to the MySQL database
    protected Connection getConnection ( String host, String database )
    throws Exception {
    String url = "";
    try {
    url = "jdbc:mysql://" + host + "/" + database;
    Connection con = DriverManager.getConnection(url);
    System.out.println("Connection established to " + url + "...");
    return con;
    } catch ( java.sql.SQLException e ) {
    System.out.println("Connection couldn't be established to " + url);
    throw ( e );
    * This method executes an update statement
    * @param con database connection
    * @param sqlStatement SQL DDL or DML statement to execute
    protected void executeUpdate ( Connection con, String sqlStatement )
    throws Exception { 
    try {
    Statement s = con.createStatement ( );
    s.execute ( sqlStatement );
    s.close ( );
    } catch ( SQLException e ) {
    System.out.println ( "Error executing sql statement" );
    throw ( e );
    * This method executes a select statement and displays the result
    * @param con database connection
    * @param sqlStatement SQL SELECT statement to execute
    protected void executeQuery( Connection con, String sqlStatement )
    throws Exception { 
    try {
    Statement s = con.createStatement ( );
    ResultSet rs = s.executeQuery( sqlStatement );
    while ( rs.next ( ) ) {
    String id = ( rs.getObject ("id").toString() );
    String text = ( rs.getObject ("text").toString() );
    System.out.println ( "found record : " + id + " " + text );
    rs.close ( );
    } catch ( SQLException e ) {
    System.out.println ( "Error executing sql statement" );
    throw ( e );
    * This one is used to start the program.
    public static void main ( String args[] ) throws Exception {
    if ( args.length == 2 ) {
    new TestMySQL ( ).test ( args[0], args[1] );
    } else {
    System.out.println ( "usage: java TestMySQL host database" );
    when I compile and run the program, I still get a java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I get the same error when I use the following driver as well
    org.gjt.mm.mysql.Driver
    Does my java program have to be in a certain directory in relation to the mysql directory? All I did at the msql> prompt was to create a database called jtest and typed in
    C:\java TestMySQL localhost jtest
    in order to run the above program.
    Am I overlooking something? Have I forgotten to do something? I am currently using jdk1.3 instead of jdk1.4, is that the problem?? If it is, how do I correct the problem without switching to jdk1.4??
    Any and all help is appreciated, and I sincerely thank all developers who read this post.
    Take care.
    Sincerely;
    Fayyaz

    syedfa,
    I don't know if you have already figured out the problem that you were experiencing, but I was having this same problem, and I finally got it figured out. I was having difficulty on how exactly to set the classpath. I am using Windows XP, and I have seen and tried a lot of different variations. From the command prompt in the directory where the file was saved I finally got your program to compile using:
    java -classpath C:\mysql\mysql-connector-java-2.0.
    14\mysql-connector-java-2.0.14-bin.jar; TestMySQL localhost test
    Of course it would be much easier if the environment variable for this was set so you don't have to type it in everytime at the command prompt, and I finally got that one figured out to. If you are using Windows XP then you can:
    Right click on My Computer and go to Properties.
    Click on Advanced.
    Click on Environment Variables.
    Under System Variables, click on New.
    For the Variable name type: CLASSPATH
    For the Variable Value type: .;C:\mysql\mysql-connector-java-2.0.14\mysql-connector-java-2.0.14-bin.jar
    In the above variable value, the ".;" before C: isn't a typo. The path that I put in is the path to the MySQL JDBC driver on my computer so it may vary on your computer.
    I think this will also work with Windows 2000.
    I hope this helps if you still need it, maybe it will also help somebody else with the same problem.

Maybe you are looking for

  • JQuery Tutorial needed to customize Add New Item and Edit Item forms

    Hello, I need a tutorial to use JQuery to customize the UI Screen of SharePoint to add a new item in a list. since I don't have prior UI experience it will be nice if the tutorial is specifically targetted towards customizing the automatic form which

  • JDev3.0's JSP and Applet works on NT but doesn't work on Win98, why?

    JDeveloper3.0 works fine on WindowNT machine when I run JSP files and Applet, but at home the JDeveloper3.0 cannot trigger the browser to display the result on my Windows98 machine when I run the JSP files or Applet. Why? How can I make it works for

  • Change Sql server of sharepoint 2013

    I have instlled sharepoint 2013 with sql express edition. Now the issue is rising that my database grows up more than 10gb. Now i want to move it to sql express edition. Suggest me the best way to do? I have database backup. Sharepoint site backup an

  • ITunes cannot find file??

    Recently i have purchased a movie on iTunes but when i went to watch it, it had that exclamation point next to it and it tells me that the original file cannot be located?? does anyone know have to fix this??

  • Opening files in Soundbooth is slow generating waveform

    Despite the fact that I run an extremely fast Mac Pro with 8GB RAM, two 3.0GHz quad Xeon processors, and a hardware RAID, I still have to wait for Soundbooth to "generate waveform" even though the visual representation of the waveform appears immedia