Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. Visual Phonebook with database

Visual Phonebook with database

Scheduled Pinned Locked Moved Support
10 Posts 3 Posters 589 Views
  • 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.
  • C
    C
    clinnovations
    wrote on last edited by
    #1

    Im trying to make my fop2 version 2.26 use phonebook with my database in a non pbx installation

    I activated
    define('DEBUG',true); in config.php

    when i go to:
    http://X.X.X.X/fop2/phonebook.php

    i get :
    "']+)\s*$/",$line,$matches)) { $conf[ $matches[1] ] = trim($matches[2]); } } } else { die("
    ".sprintf("Missing or unreadable config file (%s)...cannot continue", $filename)."
    "); } return $conf; } ?> You do not have permissions to access this resource.

    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #2

      At the top of config.php you can define a mysql user, password and database. You have to create that database and populate it with the tables found in the mysql-tables.db file in the web directory. Once that is done, everything will work. You do not need to modify php files, just create the database and set the proper credentials at the top of config.php

      Best regards,

      1 Reply Last reply
      0
      • C
        C
        clinnovations
        wrote on last edited by
        #3

        I populated my database with the mysql.db from the fop2 web directory and set config.php mysql user, password and database.

        when i go to:
        http://X.X.X.X/fop2/phonebook.php

        i still get this error:
        "']+)\s*$/",$line,$matches)) { $conf[ $matches[1] ] = trim($matches[2]); } } } else { die("
        ".sprintf("Missing or unreadable config file (%s)...cannot continue", $filename)."
        "); } return $conf; } ?> You do not have permissions to access this resource.

        when i go in my fop2 web interface and click on phonebook it won't open it just kept loading.

        1 Reply Last reply
        0
        • N
          N
          nicolas
          wrote on last edited by
          #4

          An error should not display php code,... what fop2 version do you have? how does the first two lines of phonebook.php look like?

          1 Reply Last reply
          0
          • C
            C
            clinnovations
            wrote on last edited by
            #5

            Im using version 2.26 and the first 2 line of phonebook.php look like this
            <?php
            header("Content-Type: text/html; charset=utf-8");
            require_once("config.php");
            ?>
            and those are the one for config.php

            <?
            // Database connection details
            //
            // Only needed if you do not use FreePBX or want to specify
            // a different database than the freepbx one.

            $DBHOST = 'localhost';
            $DBNAME = 'fop2';
            $DBUSER = 'XXX';
            $DBPASS = 'XXXXXXX';

            1 Reply Last reply
            0
            • C
              C
              clinnovations
              wrote on last edited by
              #6

              config.php

              <?php
              // Database connection details
              //
              // Only needed if you do not use FreePBX or want to specify
              // a different database than the freepbx one.
              added php but now i getting this
              notice
              /var/www/fop2/lib/dblib.php (line 234)

              mysql_fetch_assoc() expects parameter 1 to be resource, boolean given
              notice
              /var/www/fop2/lib/dbgrid.php (line 1020)

              Function split() is deprecated
              notice
              /var/www/fop2/lib/dbgrid.php (line 1020)

              Function split() is deprecated
              Add Delete Marked Export Import Search

              First Name Last Name Phone 1 Phone 2 Company Picture
              No records found
              «‹1 ›»
              Page : 1 of 0 . Total records found: 0

              1 Reply Last reply
              0
              • N
                N
                nicolas
                wrote on last edited by
                #7

                Im using version 2.26 and the first 2 line of phonebook.php look like this

                $DBHOST = 'localhost';
                $DBNAME = 'fop2';
                $DBUSER = 'XXX';
                $DBPASS = 'XXXXXXX';

                Are you sure the above data is correct? can you connect to it with the mysql command line client:

                mysql -u XXX -pXXXXXXX -h localhost fop2
                
                1 Reply Last reply
                0
                • C
                  C
                  clinnovations
                  wrote on last edited by
                  #8

                  yes im able to connect to mysql database fop2 with the command.

                  mysql -u XXX -pXXXXXXX -h localhost fop2

                  PHP 5.4.7 (cli) (built: Sep 14 2012 14:44:02)
                  Copyright (c) 1997-2012 The PHP Group
                  Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
                  root@SIP:/var/www/fop2/lib# mysql -u XXX -pXXXXXX fop2 -e "desc visual_phonebook"
                  +-----------+------------------+------+-----+---------+----------------+
                  | Field | Type | Null | Key | Default | Extra |
                  +-----------+------------------+------+-----+---------+----------------+
                  | id | int(11) | NO | PRI | NULL | auto_increment |
                  | firstname | varchar(50) | YES | MUL | NULL | |
                  | lastname | varchar(50) | YES | | NULL | |
                  | company | varchar(100) | YES | | NULL | |
                  | phone1 | varchar(50) | YES | | NULL | |
                  | phone2 | varchar(50) | YES | | NULL | |
                  | owner | varchar(50) | YES | | | |
                  | private | enum('yes','no') | YES | | no | |
                  | picture | varchar(100) | YES | | NULL | |
                  | context | varchar(150) | YES | | | |
                  +-----------+------------------+------+-----+---------+----------------+

                  1 Reply Last reply
                  0
                  • N
                    N
                    nicolas
                    wrote on last edited by
                    #9

                    You are seeing unparsed php code in phonebook.php, be sure the php is interpreted correctly, there is a missing opening php tag , or some error of that sort.

                    1 Reply Last reply
                    0
                    • B
                      B
                      boatman810
                      wrote on last edited by
                      #10

                      I think I blew away my correct permissions for visual_phonebook
                      re-applied these
                      grant all privileges on . to 'root'@'%' with grant option;
                      grant all privileges on . to 'root'@'localhost' with grant option;
                      flush privileges;
                      restarted db
                      have 4900+ entries, and can see only the 2 that I have manually entered from gui
                      I can see the 2 from the command line as well
                      mysql -u root -pfakenew-password -h localhost fop2 -e "show tables"
                      this command works fine
                      any suggestions

                      ver 2.29.01

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      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.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups