Add module nginx psql - postgresql

I need to add the http_postgres_module module
Here's what I do:
root # fp-desk: /home/floriane/openresty-1.11.2.5# ./configure --with-http_postgres_module;
It compiles some but not completely. I get this error:
ngx_http_form_input_module was configured
adding module in ../encrypted-session-nginx-module-0.06
found ngx_devel_kit for ngx_encrypted_session; looks good.
ngx_http_encrypted_session_module was configured
adding module in ../ngx_postgres-1.0
checking for libpq library version 9.1 ... not found
checking for libpq library version 9.0 ... not found
checking for libpq library version 8.4 ... not found
checking for libpq library version 8.3 ... not found
checking for libpq library version 8.2 ... not found
checking for libpq library version 8.1.4 ... not found
checking for libpq library version 8.1.0 ... not found
checking for libpq library version 8.0.8 ... not found
checking for libpq library version 8.0.0 ... not found
./configure: error: ngx_postgres addon was unable to detect version of the libpq library.
ERROR: failed to run command: sh ./configure --prefix=/usr/local/openresty/nginx ...
root#fp-desk:/home/floriane/openresty-1.11.2.5#

For CentOS or RHEL user, try to install postgresql-devel package.
yum install postgresql-devel
This works for me.

Related

cannot link libpq on Mac M1

I've been trying to run the Rust Diesel crate on my Macbook M1 and it doesn't work. The final part of the compilation gets broken by the following error:
= note: ld: warning: ignoring file /usr/local/Cellar/libpq/14.1/lib/libpq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
When I get the info for libpq I get the following:
maxwellflitton#Maxwells-MacBook-Pro vanguard % brew info libpq
libpq: stable 14.1 (bottled) [keg-only]
Postgres C API library
https://www.postgresql.org/docs/14/libpq.html
/usr/local/Cellar/libpq/14.1 (2,335 files, 27.8MB)
Poured from bottle on 2022-01-09 at 00:14:32
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libpq.rb
License: PostgreSQL
==> Dependencies
Required: krb5 ✔, openssl#1.1 ✔
==> Caveats
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.
If you need to have libpq first in your PATH, run:
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.zshrc
For compilers to find libpq you may need to set:
export LDFLAGS="-L/usr/local/opt/libpq/lib"
export CPPFLAGS="-I/usr/local/opt/libpq/include"
I've tried installing with the following command:
RUSTFLAGS='-L /usr/local/Cellar/libpq/14.1/lib' cargo install diesel_cli --no-default-features --features postgres --force
But I still get the same error. Will it just be easier to wipe the whole thing and start again and if so how would I do this? Other people on the internet using the M1 seem to be able to get round the problem with a simple brew install libpq. Never had any issues with my previous intel mac. My ~/.cargo/config.toml has the following configuration:
[target.aarch64-apple-darwin]
rustflags = '-L /usr/local/Cellar/libpq/14.1/lib -L /opt/homebrew/lib'
Surprisingly this worked
brew install postgresql libpq
cargo clean
cargo build
cargo install diesel_cli --no-default-features --features postgres
I think it had to do with installing diesel-cli before installing the necessary dependencies. Cleaning the cargo dependencies and reinstalling worked for me
on my M1 mac, I installed the postgresql client and library with brew:
brew install postgresql libpq
and attempted to install diesel_cli again, this time it worked fine:
cargo install diesel_cli --no-default-features --features postgres
for some reason, simply installing libpq was not enough to install diesel_cli, i had to install the postgres library and the client.
Encountered a similar problem, and the issue was coming from my brew config (I restored my filesystem from my mac Intel) :
❯ brew config
...
macOS: 12.6-x86_64
...
Therefore, brew was downloading packages built for intel processors. I uninstalled and reinstalled brew following their website and now brew config is correct:
❯ brew config
...
macOS: 12.6-arm64
...
Hope this helps!
I have a Mac M1 and installed both postgresql and libpq with brew
I eventually succeeded in installing diesel_cli with these lines in my ~/.cargo/config.toml file
[target.aarch64-apple-darwin]
rustflags = '-L /opt/homebrew/opt/libpq/lib -L /opt/homebrew/lib'
source was https://github.com/diesel-rs/diesel/issues/2605

CentOS: RVM and no package libyaml available

I'm trying to install RVM on a CentOS host and it fails with this error:
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby: error while loading shared libraries: libruby.so.1.9: cannot open shared object file: No such file or directory
Libraries missing for ruby-1.9.3-p194: libruby.so.1.9. Refer to your system manual for installing libraries
Mounting remote ruby failed, trying to compile.
After some Googling it seems I need to manually install the libyaml package, to which the host says:
No package libyaml available.
Any ideas?
Try installing this using RVM :
rvm pkg install libyaml
It works on my CENTOS 6.3 VPS.
with the latest rvm (run rvm get head), libyaml is automatically fetched when installing Ruby (well, at least on 1.9.3).
You'll see if it has been installed by inspecting /usr/local as that's where rvm puts it...
I've managed to solve it by piecing together others' attempts. I followed these instructions, and despite getting an error that read:
Error running 'autoreconf -is --force', please read /usr/local/rvm/log/ruby-1.9.2-p320/yaml/autoreconf.log
I managed to install both the rake gem and the rails gem.

imagick and mongo on OSX lion with brew

I am trying to install imagick and mongo on osx lion. Note that my php installation is done via homebrew. I have installed the packages correctly and it should work but php returns the following
Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
Any clues on how to fix that?
The PHP errors indicate that you've compiled extensions for a different API version (20090626 API is PHP 5.3) from the server you are trying to use the extensions with (20100525 API is PHP 5.4).
I suspect that you have installed PHP 5.4 via homebrew, but managed to pick up the OS X default headers (PHP 5.3) when compiling the extensions. You need to either recompile your extensions with PHP 5.4, or downgrade your web server to PHP 5.3.
You can check the version of PHP headers in your path using php-config:
php-config --version
And the version of PHP and extension API with:
php -i | egrep "PHP (Extension|Version)"
Possible fixes:
Include /usr/local/bin in your path first so the homebrew PHP versions are found in preference to the system default:
export PATH=/usr/local/bin:$PATH
Install PHP 5.3 via Homebrew:
brew uninstall php54
brew install php53
For reference, I'd like to add that
when brew installs php it sets the additional ini files read folder to
/usr/local/etc/php/5.4/php5/conf.d
whilst it actually is
/usr/local/etc/php/5.4/conf.d
you can easily fix that by symlinking
cd /usr/local/etc/php/5.4/
mkdir php5
cd php5
ln -s ../conf.d .

MongoDB Install Error

Just setup a fresh server at MediaTemple (dedicated virtual / CentOS Linux) and installed the developer tools, but Mongo won't install, any ideas?
Also, it's trying to DL version 1.2.10 I assume I can run pecl upgrade mongo once it is installed to go to 2.0.6 right?
Here's my output:
[root ~]# pecl install mongo
downloading mongo-1.2.10.tgz ...
Starting to download mongo-1.2.10.tgz (86,463 bytes)
.....................done: 86,463 bytes
36 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/mongo-1.2.10
running: /root/tmp/pear/cache/mongo-1.2.10/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... //bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/cache/mongo-1.2.10/configure' failed
You're not installing mongodb with pecl, here you're installing the PHP driver for mongodb.
To install mongodb on CentOS, please follow these instructions here. These instructions show you how to add the 10gen repo, which will then enable you (using yum) to install the latest production-ready mongodb release (2.0.6).
I realise that it's not Ubuntu but egarding your issue with installing the PHP driver, does it make any difference if you run
sudo pecl install mongo
There's some information here on installing the mongo php driver, just replace the 'apt-get' elements with 'yum' as the same libraries, dependencies apply afaik.
Here's a tutorial on using the mongo php driver.

PHP :mbstring module install

I have tried to install the mbstring module for PHP. I have entered the below commands:
yum install php-mbstring
/usr/local/apache/bin/apachectl restart
Module is now installed but the errors has not dissapeared.
Fatal error: Call to undefined function mb_send_mail()
In my phpinfo(), "mbstring" doesn't exist...
OS: centos 6
PHP: 5.3.8
How did you install PHP on your system? The PHP version currently supported via YUM install is 5.3.3, but you said your PHP version is 5.3.8 which leads me to believe that you may have compiled PHP manually. If so, you will have to recompile with the --enable-mbstring flag.