title: load php extensions in apache
body: <p>I think i am almost through setting up php and mysql together with apache on my debian server but it looks like the mysql extensions are not loaded when I serve pages </p>
  
  <p>I only have basic understanding of apache conf files so I am probably missing something. All packages (debian, php5-mysql, mysql-server etc.) are up to date, so I suspect the issue comes from the way apache loads the php module. </p>
  
  <p>Trying to run the serve this page (on Firefox client) confirms that all my extensions (especially mysql) are not loaded:</p>
  
  <pre><code>&lt;?php
  echo(phpversion());
  ?&gt;
  
  
  &lt;?php
  print_r(get_loaded_extensions());
  ?&gt;
  </code></pre>
  
  <blockquote>
    <p>5.4.44-0+deb7u1</p>
    
    <p>Array ( [0] => Core [1] => date [2] => ereg [3] => libxml [4] => openssl [5] => pcre [6] => zlib [7] => bcmath [8] => bz2 [9] => calendar [10] => ctype [11] => dba [12] => dom [13] => hash [14] => fileinfo [15] => filter [16] => ftp [17] => gettext [18] => SPL [19] => iconv [20] => json [21] => mbstring [22] => session [23] => posix [24] => Reflection [25] => standard [26] => shmop [27] => SimpleXML [28] => soap [29] => sockets [30] => Phar [31] => exif [32] => sysvmsg [33] => sysvsem [34] => sysvshm [35] => tokenizer [36] => wddx [37] => xml [38] => xmlreader [39] => xmlwriter [40] => zip [41] => apache2handler [42] => mhash ) </p>
  </blockquote>
  
  <p>Where as running with php form terminal yields what I would like:</p>
  
  <pre><code> $ php test.php
  </code></pre>
  
  <blockquote>
    <p>5.6.13</p>
    
    <p>Array
    (
        [0] => Core
        [1] => date
        [2] => ereg
        [3] => libxml
        [4] => pcre
        [5] => sqlite3
        [6] => ctype
        [7] => dom
        [8] => fileinfo
        [9] => filter
        [10] => hash
        [11] => iconv
        [12] => json
        [13] => SPL
        [14] => session
        [15] => standard
        [16] => mysqlnd
        [17] => PDO
        [18] => pdo_mysql
        [19] => pdo_sqlite
        [20] => Phar
        [21] => posix
        [22] => Reflection
        [23] => mysqli
        [24] => SimpleXML
        [25] => mysql
        [26] => tokenizer
        [27] => xml
        [28] => xmlreader
        [29] => xmlwriter
    )</p>
  </blockquote>
  
  <pre><code> $ php5 test.php
  </code></pre>
  
  <blockquote>
    <p>5.4.44-0+deb7u1</p>
    
    <p>Array
    (
        [0] => Core
        [1] => date
        [2] => ereg
        [3] => libxml
        [4] => openssl
        [5] => pcre
        [6] => zlib
        [7] => bcmath
        [8] => bz2
        [9] => calendar
        [10] => ctype
        [11] => dba
        [12] => dom
        [13] => hash
        [14] => fileinfo
        [15] => filter
        [16] => ftp
        [17] => gettext
        [18] => SPL
        [19] => iconv
        [20] => json
        [21] => mbstring
        [22] => pcntl
        [23] => session
        [24] => posix
        [25] => Reflection
        [26] => standard
        [27] => shmop
        [28] => SimpleXML
        [29] => soap
        [30] => sockets
        [31] => Phar
        [32] => exif
        [33] => sysvmsg
        [34] => sysvsem
        [35] => sysvshm
        [36] => tokenizer
        [37] => wddx
        [38] => xml
        [39] => xmlreader
        [40] => xmlwriter
        [41] => zip
        [42] => PDO
        [43] => gd
        [44] => intl
        [45] => mcrypt
        [46] => mysql
        [47] => mysqli
        [48] => pdo_mysql
        [49] => mhash
    )</p>
  </blockquote>
  
  <p>Any help is welcomed, also I am quite new around here so if more information is needed just let me know! </p>
  
  <hr>
  
  <p>my configuration:</p>
  
  <pre><code>$ sudo more /etc/issue
  Debian GNU/Linux 7.8
  
  Linux **** 3.14.32-xxxx-grs-ipv6-64 #1 SMP Sat Feb 7 11:35:27 CET 2015   x86_64
  U/Linux
  
  
  
  $ php5 -v
  PHP 5.4.44-0+deb7u1 (cli) (built: Aug 16 2015 09:51:53)
  Copyright (c) 1997-2014 The PHP Group
  Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
  
  
  
  $ php -v
  PHP 5.6.13 (cli) (built: Sep 10 2015 04:46:14)
  Copyright (c) 1997-2015 The PHP Group
  Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies`
  
  
  $ apache2 -V
  Server version: Apache/2.2.22 (Debian)
  Server built:   Aug 18 2015 09:51:24
  Server's Module Magic Number: 20051115:30
  Server loaded:  APR 1.4.6, APR-Util 1.4.1
  Compiled using: APR 1.4.6, APR-Util 1.4.1
  Architecture:   64-bit
  Server MPM:     ITK
    threaded:     no
    forked:     yes (variable process count)
  Server compiled with....
  -D APACHE_MPM_DIR="server/mpm/experimental/itk"
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D DYNAMIC_MODULE_LIMIT=128
  -D HTTPD_ROOT="/etc/apache2"
  -D SUEXEC_BIN="/usr/lib/apache2/suexec"
  -D DEFAULT_PIDLOG="/var/run/apache2.pid"
  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
  -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
  -D DEFAULT_ERRORLOG="logs/error_log"
  -D AP_TYPES_CONFIG_FILE="mime.types"
  -D SERVER_CONFIG_FILE="apache2.conf"
  
  
  $ more /etc/apache2/mods-enabled/php5.conf
  &lt;FilesMatch ".+\.ph(p[345]?|t|tml)$"&gt;
      SetHandler application/x-httpd-php
  &lt;/FilesMatch&gt;
  &lt;FilesMatch ".+\.phps$"&gt;
  SetHandler application/x-httpd-php-source
  # Deny access to raw php sources by default
  # To re-enable it's recommended to enable access to the files
  # only in specific virtual host or directory
  Order Deny,Allow
  Deny from all
  &lt;/FilesMatch&gt;
  # Deny access to files without filename (e.g. '.php')
  &lt;FilesMatch "^\.ph(p[345]?|t|tml|ps)$"&gt;
      Order Deny,Allow
      Deny from all
  &lt;/FilesMatch&gt;
  
  # Running PHP scripts in user directories is disabled by default
  #
  # To re-enable PHP in user directories comment the following lines
  # (from &lt;IfModule ...&gt; to &lt;/IfModule&gt;.) Do NOT set it to On as it
  # prevents .htaccess files from disabling it.
  &lt;IfModule mod_userdir.c&gt;
      &lt;Directory /home/*/public_html&gt;
          php_admin_value engine Off
      &lt;/Directory&gt;
  &lt;/IfModule&gt;
  
  $ more /etc/apache2/mods-enabled/php5.load
  LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
  </code></pre>
  
  <hr>
  
  <pre><code>$ php -i |grep ini
  Configuration File (php.ini) Path =&gt; /usr/local/lib
  Scan this dir for additional .ini files =&gt; (none)
  Additional .ini files parsed =&gt; (none)
  user_ini.cache_ttl =&gt; 300 =&gt; 300
  user_ini.filename =&gt; .user.ini =&gt; .user.ini
  init_command_executed_count =&gt; 0
  init_command_failed_count =&gt; 0
  com_init_db =&gt; 0
  Classes =&gt; AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, 
  CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator,
  FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException,
  LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, 
  ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, 
  RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException,
  SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue,
  SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
  </code></pre>