[CLOSED] Weird mysql/php issue.

Hi,
I am running an ArchLinux as my Server. It's a fresh install. I just configured nginx as my Webserver and then configured MySQL. I wanted to use phpMyAdmin as a manager. I installed it via wget and it worked fine. But all of a sudden it would not let me log in anymore. The log in screen just keeps on popping up, without any errors or anything. It tried reinstalling phpMyAdmin, I also tried the alternative chive. In chive I get the error "CDbConnection failed to open the DB connection." I really am at a loss here, has anyone else encountered a similar issue and can point me in the right direction?
Disclaimer: Please excuse my possibly poor english, as it is not my native language, also please excuse any questions that may sound noob-like, because I am quite new to Arch.
Last edited by oengelha (2012-12-15 17:40:09)

config.inc.php should be in
/etc/webapps/phpmyadmin
but the installation symlinks that file to
/usr/share/webapps/phpMyAdmin
where the installation is.
You'll have to add this directive in open_basedir @
/etc/php/:/usr/share/webapps/
Also might need an alias in
/etc/nginx/nginx.conf
What I do is symlink
ln -s /usr/share/webapps /srv/http/.webapps
/srv/http being my www directory I can visit mysite.com/.webapps/phpMyAdmin to access.
This can be a security issue, maybe allow only local access or use another mean of accessing the installation.
Also symlinking just the installation directory to a hidden directory precursed with '.' won't float, like mysite.com/.phpmyadmin
Last edited by ackt1c (2012-12-16 17:44:01)

Similar Messages

  • MySQL & PHP issues since upgrade

    Little bit of background: I ran an arch server about two years ago, basically a personal web server (for about a year).  Had apache, mysql and php running nicely on it using the basic configurations with some minor changes.
    Now, present day.  I have recently installed Arch again and once the upgrades were announced, I held off on installing the LAMP applications.  So, Friday I installed them (as oppsed to upgrading), and thought I had them all working fine.  Apache was running, mysql was running (command line access was working well with one exception, more on that later), and php was being parsed.  When I tried to pull data out of a database, i was getting "call to undeclared function mysql_pconnect()."  I googled the error and searched the Arch forums, and everything said to make sure php was compiled with the '--with-mysql' option.  I checked that using phpinfo(), and indeed it was, but it was '--with-mysql=/shared', /usr' (or something similar).  What I ended up doing was removing the arch package and recompiling php myself using '--with-mysql' (no arguments) and it works beautifully.  So, basically, is the arch configuration for php correct?
    Also, issue number two, I have created a non-root user in mysql, but when i try to log in i receive access denied for 'user@localhost' (using password: YES).  Did i miss a setting that won't allow me to log in as anyone but root?
    Thanks in advance. 

    simple, edit your php.ini like so:
    BEFORE:
    1250:;extension=mysql.so
    AFTER
    1250:extension=mysql.so
    no need to recompile php.
    ps: "grep -n mysql.so /etc/php.ini"

  • Apache/MySQL/PHP and Mountain Lion

    I was about to buy Mountain Lion, but I just read by a reviewer that there is an issue with the webserver or websharing capabilities of it. The reviewer was saying he/she had to go into the terminal and launch it from there!
    Is anybody else having issues with developing database driven sites on Mountain Lion, or are you getting on OK with it?
    I currently use xammp as my apache/mysql/php server. Is anybody on Mountain Lion using xammp, if not, what equivalent are you using?
    Thanks.
    Mat

    Starting Apache is very easy. Simply type the following into a terminal:
    sudo apachectl start
    I think that they removed the tick box because it's so easy to do from terminal, and not something that most OSX users need.
    As SnakEyez02 mentioned, using a package like MAMP or XAMPP doesn't require this. Those apps run their own Apache

  • Update MySQL & PHP Version

    I have a Mac Mini that I am using as a server and I can't figure out how to go about updating the MySQL & PHP that is controlled by the ServerAdmin app. Any ideas?

    I ran an install of 10.4.4. The update ran with no problems.

  • Inserting & uploading records with Dreamweaver CS3, MYSQL & PHP

    I'm able to build a web page that allows for images to be
    uploaded to a server folder. Also have a web page created to insert
    info about the image into a MYSQL/PHP database.
    My goal is to find a way to combine the two together so that
    when you click the submit button... 1) the image gets uploaded to
    the server folder, 2) the info about the image gets placed into the
    database table, and 3) there is an entry in the database that
    establishes the path to the image.
    Any help or direction to a tutorial would be greatly
    appreciated.

    I use a DW extension from DMXzone (Pure PHP Upload) that
    allows me to both insert data form an online form into a MySQL
    table as well as upload files to a directory on the server with one
    button click. This might be a solution for you.

  • Bootstrap + mysql + php: robust solution for an educational dashboard?

    Hi. We are just beginning work on a dashboard for educational purposes. We need to show data tables of sts progress, notes etc...
    Kind of like the following tables:
    http://www.dreambox.com/district-reports
    We have downloaded a template based on bootstrap. It is all pretty easy except for the data integration. Before we were using flash datagrids and were also looking at flex components which were very easy to use. The questions are:
    1. Can we get the same "power" for our data tables/data grids with bootstrap "ready made" plugin ins.
    2. To replicate the datadrid in flash what do we use in bootstrap - ajax datatable or a j query plug in.
    3. How do we connect up the mysql + php + datagrid. Would it be very similar to an AS3 + php + mysql solution?
    Basically, is bootstrap html5 + CSS a viable robust solution to producing an educational dashboard.
    I use the term plugin because I don't think you call them components or widgets.
    You must also know that this will be on an enterprise level and there should be around 10,000 active users - not at the same time obviously. We will be hiring a freelancer or part tim staff to implement and maintain but we do need to know which way to go first.
    Pretty broad questions maybe, just trying to find my way and study up on what I am supposed to be studying up on. I am on Lynda.com which is OK but I need some guys creating these things to give me advice and point us in the right direction.
    Cheers in advance.

    Hi - thank you Nancy - I should get really specific now.
    I spent quite a few hours investigating and here's the run down.
    1. php + mysqli: Pretty easy as it is the same workflow as I use in flash - I was just a bit thrown by the html part and still have a few questions.
    I will post the link to the very clean and easy to follow mysql + php implementation on html tables just in case any newbies are following the post.
    http://www.sourcecodetuts.com/php/18/how-create-secure-registration-page-phpmysql-part-ii
        mysqli - they seem to use the "improved" mysqli now and this code seems to be very professional with encryption etc...
    My question is which is the best method for handling the recordset back from the database.
    1. In flash we used to use XML serialized which is easy for flash objects to pick up and then display in the datagrid tables.
    2. The example in the next link echos it out in the html table format which sounds very obvious but not sure if it is correct as I have never dome that before.
    http://www.sourcecodetuts.com/php/40/creating-and-populating-table-mysql-data-using-twitte r-bootstrap-framework
    while ($row = mysql_fetch_array($result)) {
        // Print out the contents of the entry
        echo '<tr>';
        echo '<td>' . $row['firstname'] . '</td>';
        echo '<td>' . $row['lastname'] . '</td>';
        echo '<td>' . $row['email'] . '</td>';
        echo '<td>' . $row['phone'] . '</td>';
    3. However I am more used to dealing with an object returned and then dealt with in flash BUT a simple html table couldn't deal with that so - I have just started reading re: ajax or javascript. Are they the best way to handle data returned from a database. As I say this dashboard wil have to be used my many thousands and we will be creating various tables with multiple parameters inputted via dropdown box lists.
    My workflow in flash - would it be javascript that would replicate that functionality or do I just echo out in tr and td tags as in above - seems to basic.
    Sorry about repeating mysel above and going on and on but I hace finally got there - just missing the last part in the puzzle.
    Cheers

  • CANNOT FIND mmhttpdb.php  and mysql.php  files

    does anyone know where I can download these two files from ? (in order to connect to database)
    mmhttpdb.php     mysql.php
    I deleted them accidentially.

    * Vista/Windows 7: C:\Program Files (x86)\Adobe\Adobe Dreamweaver CC\Configuration\DisabledFeatures
    * Mac OS X: /Applications/Adobe Dreamweaver CC/Configuration/DisabledFeatures
    If they no longer reside anywhere including your trash/recycle bin, you may need to re-install CC.
    Nancy O.

  • Weird database related PHP issue

    Basically I have a regular page that lists a bunch of
    Candidates from a table :
    CandidateID, Candidate
    They link through to a details page on CandidateID
    On the listing page, I also have a link to an Edit Candidate
    Details page, using :
    [CODE]
    <a href="editCandidateEmail.php?CandidateID=<?php echo
    $row_Candidates['CandidateID']; ?>"><img
    src="../Images/edit7.gif" border="0" width="28px" height="18px"
    /></a>
    [/CODE]
    Which works just as it should. So far so good.
    On my details page, I have the exact same link to the edit
    deatils page, using :
    [CODE]
    <a href="editCandidateEmail.php?CandidateID=<?php echo
    $row_Candidates['CandidateID']; ?>"><img
    src="../Images/edit7.gif" border="0" width="28px" height="18px"
    /></a>
    [/CODE]
    The weird thing is that it works sometimes, but not others.
    The error is :
    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 '' at line 1
    And the URL is just missing the ID off the end of the link,
    so looks like :
    ../editCandidateEmail.php?CandidateID=
    Instead of
    ../editCandidateEmail.php?CandidateID=1234
    The recordset is named 'Candidates', and there is a
    CandidateID present.
    Any clue as to what might be causing this?
    Cheers.

    d'oh! Figured out what was happening - there were two
    recordsets on the details page, and one involved a join to another
    table - so if a CandidateID wasn't present in the other look up
    table, it wasn't being referenced by that recordset - so I just
    changed those links to refer to the simple recordset that referred
    directly to the Candidates table.

  • PHP mysql PDO issue

    Hi all,
    I just installed LAMP stack following the instructions in Wiki.  Looks like PHP 5.3.6 will not load PDO drivers for mysql.  phpinfo() shows the following line for PDO:
    PDO support    enabled
    PDO drivers    no value
    I have extensions mysqli.so, mysql.so and pdo_mysql.so uncommented in the php.ini.
    php -m shows only PDO and mysqlnd loaded.
    My application works fine on Ubuntu server running PHP 5.3.3.
    Did anyone else run into this problem before?
    Thanks in advance.

    Ok,
    I found that copying the php.ini.pacnew over the old one and uncommenting the appropriate extensions it started working.  But I stumbled over some strange beahiour with error reporting. When I activate
    Development Value: E_ALL | E_STRICT
    This brakes the pdo extensions ... very annoying.

  • Weird PHP issue with Server 4.0.3

    Yosemite 10.10.2
    OS X Server 4.0.3
    default PHP installation 5.5.14
    Ok, so I successfully added a couple of Virtual Host websites, strictly using the OS X Server.app, and I can browse on my local network using the private url I gave them.
    The problem is, on one of my websites, the PHP that renders the menu isn't working properly. I'm not smart enough to understand exactly why or what's going wrong. It does this whether I host the files in the standard document root, or my own virtual host folder.
    Here's how it looks when hosted by OS X Server's Apache (i.e. - wrong)
    And for comparison, here's how it looks using MAMP (i.e. - perfect)
    The index.php of the site is literally just this and nothing more…
    <?php
         include('head.html');
    ?>
    <?php
         include('logo.html');
    ?>
    <?php
         include('menu.html');
    ?>
    <?php
         include('showreel/showreel.html');
    ?>
    The PHP error appears to be happening in the menu.html portion, in particular the array section. I've copied it here for you to see http://pastebin.com/fpAi2YjF
    I have a info.php file that confirms php is on, and the checkbox 'Enable PHP Web Applications' is checked in Server.app.
    Now, I now I could use MAMP, but I'd rather not. I just want a simple, clean OS X solution. I've paid for Server.app and I want to use it. I'm only hosting these sites for dev purposes on my local network. Also I have no use for MySQL, etc. MAMP is overkill for my needs.
    Any idea what I did wrong? Or what I need to change? I'm thinking maybe apple's version of PHP may have slightly different settings.

    Mark,
    Using the following code I got a properly formatted bullet list - as you would expect as I do not have the css.
    <?php
      ini_set('display_errors', '1');
      $current_url = $_SERVER['REQUEST_URI'];
    ?>
    <?php
    $menu_items = array(
            "Showreel" => "/",
            "Motion" => "/motion/index.php",
            "Animation" => "/animation/index.php",
            "Interface" => "/interface/index.php",
            "Live Action" => "/live_action/index.php",
            "Info" => "/info/index.php",
    ?>
    <div class="main_menu_container">
            <ul id="main_menu">
            <?php
        foreach ($menu_items as $title => $url)
            if($current_url==$url)
            ?>              
                            <li class='active'><?php echo $title; ?></a></li>
                            <?php
                        else  
                            ?>
                            <li><a href="<?=$url?>"><?php echo $title; ?></a></li>
                            <?php
            ?>
            </ul>
    </div>

  • DW8.02 + php + mysql recordet issue

    Am absolutely new to PHP and MySql having been using ASP
    & MSSql for a
    long while.
    I have the latest versions of PHP and MySql installed which
    would both
    appear to be working correctly.
    When I go to create a recordset in the usual manner - if I
    press test I
    can see the correct data, when I click OK to finish I get a
    series of
    JavaScipt errors "while executing findSeverBehaviours in
    recordset.htm"
    (line 53??) etc etc cannot find TomLR-PHP-AdvRS.htm
    DW puts the code in the page, but the Bindings window remains
    empty.
    I've cleared the winfilecache - anyone got any other
    suggestions??
    TIA!!
    Buzby
    There's nothing more dangerous than a resourceful idiot

    twindude wrote:
    > Buzby
    >
    > I too am trying to convert some apps to mysql
    >
    > CAn you please post how you got this to work with DW8
    >
    > I am getting an error trying to setup the RS
    > when i try to 'select database"
    > i get this:
    > Your PHP server doesn't have the MySQL module loaded or
    you can't
    > use the mysql_(p)connect functions.
    >
    > I am running php/mysql on my xp pro workstation....with
    dw8 on it
    >
    > ??? loss......
    Sounds like you haven't installed the mysql module.
    I'm sure someone who knows much much more about it than me
    will be
    along in a moment.
    However - possibly the easiest way to do it without getting
    your hands
    dirty is to delete and then reinstall PHP - make sure you do
    the
    detailed route and look out for the modules section and check
    all the
    MySql ones (sorry can't remember exactly what they were
    called - I've
    only done this twice - the first one I bodged up!) -
    otherwise it's
    trawl through your php.ini file and uncomment all the mysql
    components
    that you think you may need!
    HTH
    Buzby
    There's nothing more dangerous than a resourceful idiot

  • Help with Moodle on Mac OS X server - PhP issue

    I am a server newbie.  I am setting up a server on a mac for the primary purpose of running a website for my students to use.  I have a hosted site now, but the version of php they offer is not high enough to run moodle.  I want to install moodle 2.4 on my mac server (mountain lion) but it needs :PHP 5.3.3, MySQL 5.1.33 or Postgres 8.3.  I read that I should not try to update the native php (5.3.13)  any thoughts or workarounds?  I could install an earlier version of moodle, but it is no longer being supported with updates.

    First off, ensure that local DNS services are working.  If DNS is not working, then various services offered by OS X Server can be flaky.  Launch Terminal.app and issue the following diagnostic command:
    sudo changeip -checkhostname
    It's common for folks to skip DNS setup or to reference ISP DNS services, which usually gets them in trouble, and have a much larger project fixing DNS-level errors.
    OS X 10.8.4 should have php 5.3.15 and PostgreSQL 9.2.1, the versions of both appear to exceed the Moodle minimum requirements of 5.3.3 and 8.3, respectively.  To verify the php version, use the usual "<?php phpinfo() ?>" script.  For PostgreSQL, the brute-force command-line version check is "psql --version" command.
    Put another way, I'm not sure why you're considering upgrading components — which can be problematic — if you're already running OS X Server 10.8.4 as implied by the footers of your posting.
    Have a backup before starting the installation, as mistakes happen and having a backup of the whole disk means a faster recovery and an easier ability to start anew.

  • Mysql Variable issue

    I am passing a what will soon be my search variable into php from flash. The issue is when I need to search for something that needs to find a string value in quotes it fails.
    Below is the like field variable declared in flash
    LikeField = "Model_Profile.Gender = \'m\' ";
    This is how I am capturing my like field in php.
    $LikeField=mysql_real_escape_string($_POST['likefield']);
    Below is my query
    "SELECT count(*) AS Total FROM Model_Profile, Models  WHERE  Model_Profile.Model_ID = Models.Model_ID AND Models.Active = 1 AND {$LikeField}"
    For some reason it just doesn't seem to like the single quotes on the m, but I need them there to execute. Tracing the flash variables passed it outputs this likefield=Model%5FProfile%2EGender%20%3D%20%27m%27
    If I put the query in below it works fine, so I know it's not an issue with my query, misspelling etc.
    "SELECT count(*) AS Total FROM Model_Profile, Models  WHERE  Model_Profile.Model_ID = Models.Model_ID AND Models.Active = 1 AND Model_Profile.Gender = 'm' "
    If pass this value from flash I get a result
    LikeField = "Model_Profile.Active = 1 ";
    I am stump and don't know where the issue is at the moment.

    It's difficult to give detailed advice without knowing exactly what's going on with this app and how it's going to be implemented.  Personally I like to use stored procedures with MySQL, it helps avoid SQL Injection attacks and it also eliminates the need to deal with quote literals when building a SQL string on the fly.
    From the details you did post, it appears that your query alows the user to include or exclude the Gender feature.  How does it handle a situation in which the Gender is not set, so it's not equal to 'm' or 'f'?  Does it simply exclude that field from the WHERE clause?
    One of the biggest limitations of MySQL stored procedures is that they don't allow for default values for their parameters.  But you can program around this in the PHP call by including a default value in your PHP code that would be overridden by input from the user in the search form.
    If I were going to develop this search, I'd try to limit what I'm passing from Flash to PHP as much as possible.  I'd start with my stored procedure:
    DELIMITER $$
    DROP PROCEDURE IF EXISTS `db_name`.`sp_name` $$
    CREATE DEFINER=`root`@`%` PROCDEURE `sp_name`(prmGender varchar(1))
    BEGIN
         SELECT COUNT(*) AS Total FROM Model_Profile, Models  WHERE  Model_Profile.Model_ID = Models.Model_ID AND
    Models.Active = 1 AND Model_Profile.Gender LIKE prmGender;
    END $$
    DELIMITER ;
    In my PHP code that calls this stored procedure I'd create a variable for the gender selection and set it to '%' (the MySQL wildcard character) and override it if a specific gender was selected by the user.
    This set up allows you to ignore the whole issue of dealing with quotation marks - simply pass the appropriate letter from Flash and pass it into the gender variable in PHP, which you would assign to the stored procedure call.  I hope this is somewhat helpful, if not please provide a bit more detail on your efforts and perhaps I can provide a better option.  Good luck! 

  • Will Apple update Apache / MySQL / PHP on Tiger 10.4.11

    Recently, a scan was made on the two xServes that I have, both running 10.4.11 with only the web services set up. They are running the default bare bones setup for Tiger Server 10.4.11.
    The scan showed issues with the current install of Apache and PHP. I have been told I need to update the serves to a more secure version of Apache, Mysql, and PHP.
    Does anyone know if Apple is going to issue an update for this? Is my only option to patch together a more recent version of Apache, Mysql, and PHP to patch this?
    Or is Apple's answer to my dilemma is to just upgrade to Leopard?
    Thanks for your comments.

    Your choices here fairly limited; there's the upgrade Leopard, loading (for instance) the [MAMP|http://mamp.info] kit or other such kit and shut down the integrated stuff within Mac OS X Server, or rolling your own Apache and related pieces. If these are Intel Xserve boxes, then you could tactfully and officially drag your heels for a couple of months and upgrade to Snow Leopard.

  • Mediawiki, mysql, php? problems [SOLVED]

    On Sunday my Arch install that is hosted by Slicehost became unresponsive to them so they had to do an emergency reboot. After it came back up my install of mediawiki was (and still is) only returning a blank page (at least in Firefox). After some digging I found out that part of the problem was that mysqld wasn't starting so I managed to get that fixed by commenting out the lines relating to innodb and putting in skip-innodb into my.cnf. But I'm still getting a blank page.
    According to Mediawiki's manual, "A blank white page indicates a PHP error which isn't being printed to the screen." They give two lines to put into LocalSettings.php to force error messages but after doing that I'm still getting a blank page. Changing display_errors in php.ini to ON didn't have any effect.  When I load the wiki in Safari I get the following error: "Got java.io.EOFException (Server closed connection while sending the HTTP header.): http://some_url.com/mediawiki/index.php/Main_Page". I have no idea what this error means and googling java.io.EOFException doesn't bring up anything very helpful. My PHP Test Page indicates that PHP is up and running.
    Any ideas on fixes or where I can find more clues?
    [EDIT]
    Mysql was definitely the root of the problems with Mediawiki. I tried nearly every suggestion listed in the forums for fixing a mysql install that wouldn't start but nothing worked. I even completely uninstalled mysql and reinstalled it but it still refused to start. I switched over to postgresql and switched mediawiki to run with that. Problem solved.
    Last edited by k_odoma (2009-05-23 01:48:35)

    There are some other things that must be done to connect to
    the database
    (such as passing the usernamee, password, and host info to
    mysql_connect()
    and storing the connection resource), and those might be in
    the include
    files. I generally place all of the connection parameters in
    a separate file
    that is located in a folder that can't be accessed by a
    browser, for
    security purposes.
    Paul Swanson
    Portland, Oregon, USA
    "Amy Blankenship *AdobeCommunityExpert*"
    <[email protected]>
    wrote in message news:edk6ui$69c$[email protected]..
    > What's in the include(s)?
    >
    > "83Dons" <[email protected]> wrote in
    message
    > news:edk5s5$4uk$[email protected]..
    > > Here is the php code for the 'read' and 'write'
    parts:
    > >
    > >
    > >
    > > <?php
    > > include '......';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $sql = "select A1Answer from authorware where id =
    '13'";
    > > $result = mysql_query($sql);
    > > $answer1 = mysql_result($result,0,"A1Answer");
    > > print $answer1;
    > > ?>
    > >
    > > <?php
    > > include '............';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $newdata = $_GET['data'];
    > > mysql_query("insert into authorware (A1Answer)
    values('$newdata')")
    or
    > > die(mysql_error());
    > > mysql_close(); ?>
    > >
    >
    >

Maybe you are looking for