Closed fakharksa closed 2 years ago
Fixed via #154
Fixed via #154 @sy-records As this repository "Swoole\Library" is separate from main swoole "swoole\swoole-src" repository, so i want to know how or when the change in repository "Swoole\Library" will be incorporated into the main swoole "swoole\swoole-src" repository ?
//const POSTGRES_SERVER_DRIVER = 'pgsql'; // I get warning "Already defined" if i uncomment it const POSTGRES_SERVER_HOST = 'localhost'; const POSTGRES_SERVER_PORT = 5432; const POSTGRES_SERVER_DB = 'swooledb'; const POSTGRES_SERVER_USER = 'postgres'; const POSTGRES_SERVER_PWD = 'passwd123';
function create_db_connection_pool() { return new PDOPool( (new PDOConfig()) ->withDriver(POSTGRES_SERVER_DRIVER) ->withHost(POSTGRES_SERVER_HOST) ->withPort(POSTGRES_SERVER_PORT) // ->withUnixSocket('/tmp/mysql.sock') ->withDbName(POSTGRES_SERVER_DB) //->withCharset('utf8mb4') ->withUsername(POSTGRES_SERVER_USER) ->withPassword(POSTGRES_SERVER_PWD) ); }
include(db_connection_pool.php);
protected $conn_pool_swoole;
$this->conn_pool_swoole = create_db_connection_pool(); $pgsql_conn_swoole = $this->conn_pool_swoole->get();
Creation of connection pool without any Fatal Error
PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1698] Access denied for user 'postgres'@'localhost' in @swoole-src/library/core/Database/PDOPool.php:44 Stack trace:
0 @swoole-src/library/core/Database/PDOPool.php(44): PDO->__construct()
1 @swoole-src/library/core/Database/PDOProxy.php(41): Swoole\Database\PDOPool->Swoole\Database{closure}()
2 @swoole-src/library/core/ConnectionPool.php(89): Swoole\Database\PDOProxy->__construct()
3 @swoole-src/library/core/ConnectionPool.php(58): Swoole\ConnectionPool->make()
4 /var/www/html/swoole-prac/sw_service.php(160): Swoole\ConnectionPool->get()
5 [internal function]: sw_service->{closure}()
6 {main}
thrown in @swoole-src/library/core/Database/PDOPool.php on line 44
PHP Fatal error: Uncaught PDOException: SQLSTATE[08006] [7] invalid connection option "charset" in @swoole-src/library/core/Database/PDOPool.php:44 Stack trace:
0 @swoole-src/library/core/Database/PDOPool.php(44): PDO->__construct()
1 @swoole-src/library/core/Database/PDOProxy.php(41): Swoole\Database\PDOPool->Swoole\Database{closure}()
2 @swoole-src/library/core/ConnectionPool.php(89): Swoole\Database\PDOProxy->__construct()
3 @swoole-src/library/core/ConnectionPool.php(58): Swoole\ConnectionPool->make()
4 /var/www/html/swoole-prac/sw_service.php(160): Swoole\ConnectionPool->get()
5 [internal function]: sw_service->{closure}()
6 {main}
thrown in @swoole-src/library/core/Database/PDOPool.php on line 44
version 4.11.1
uname -a: Linux fakhar-HP-Laptop 5.17.5-76051705-generic #202204271406~1651504840~20.04~63e51bd-Ubuntu SMP PREEMPT Wed Ma x86_64 x86_64 x86_64 GNU/Linux
php -v: PHP 8.1.12 (cli) (built: Oct 28 2022 17:39:57) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.12, Copyright (c) Zend Technologies with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies
gcc -v : Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-xKiWfi/gcc-11-11.3.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)