Guest User

Untitled

a guest
Nov 23rd, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. ./configure --prefix=/opt/PHP/php-5.6 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl=/opt/openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm
  2.  
  3. <?php
  4. $servername = "localhost";
  5. $username = "username";
  6. $password = "password";
  7.  
  8. try {
  9. $conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password);
  10. // set the PDO error mode to exception
  11. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  12. echo "Connected successfully";
  13. }
  14. catch(PDOException $e)
  15. {
  16. echo "Connection failed: " . $e->getMessage();
  17. }
  18. ?>
  19.  
  20. /opt//PHP/php-5.6/bin/php connect_db.php
  21. Connection failed: SQLSTATE[HY000] [2002] No such file or directory
  22.  
  23. ./configure --prefix=/opt/PHP/php-7.1 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg-dir=/usr --with-png-dir=/usr --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm
  24.  
  25. /opt//PHP/php-7.1/bin/php connect_db.php
  26. Connected successfully
  27.  
  28. $servername = "localhost";
  29.  
  30. $servername = "127.0.0.1";
  31.  
  32. /opt/PHP/php-5.6/bin/php connect_db.php
  33. Connected successfully
Add Comment
Please, Sign In to add comment