wkhtmltopdf on Fedora 14 - compilation

Did anybody ever installed wkhtmltopdf on Fedora 14?
On http://code.google.com/p/wkhtmltopdf/wiki/compilation there is a step by step for Debian. In the comments, there is also something similar to CentOS.
Till now I have installed:
Development Tools
openssl-devel libXrender-devel libXext-devel libXft-devel
QT (qt.x86_64 qt-devel.x86_64 qt-webkit.x86_64)
git
And I have also downloaded wkhtmltopdf from git:
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf
However, the last steps are driving me crazy. Here's where So I need some help:
Compiling and installing wkhtmltopdf Now all you need to do is compile and install wkhtmltopdf
make && make install
Here's the wkhtmltopdf folder:
NEW UPDATE:
After running cd wkhtmltopdf && qmake-qt4 && make as normal user, here's what I got:
Then, I searched again for some qt packages I should have and ended with this group:
qt-webkit-devel.x86_64 php-qt-devel.x86_64 qt-x11.x86_64 qtnx.x86_64
Then, again, I ran qmake-qt4 && make and this time it passed with no errors.
Finally, I ran sudo make install and it also passed with no errors.
However, when I ran wkhtmltopdf -h it returns:
wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory
So, I decided to go all way compiling QT, following exactly the instructions. At the end, I got the same error:
$ wkhtmltopdf -h
wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory
Any help would be great.
Thanks!

wkhtmltopdf want libwkhtmltox.so.0 lib. But search it into /lib64 directory.
You can :
cd /lib64
ln -s /lib/libwkhtmltox.so.0 libwkhtmltox.so.0
wkhtmltopdf -h
is ok after that.
(sorry for my english...)

You missed the part where you have to run qmake.

cd /lib64
ln -s /lib/libwkhtmltox.so.0 libwkhtmltox.so.0
This also worked on CentOS release 6.2 (Final)

The error :
wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory
can also be caused by the miss of Xorg, then you can install it for example on Debian :
apt-get install xorg

Related

libncursesw.so.5 is installed but a program that needs it says "No such file or directory"

I'm running Ubuntu 20.04 and I am trying to run a program as such:
~/junk/cataclysmdda-0.E$ ./cataclysm
which returns
error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
I have tried a few things like, sudo apt-get install libncurses5 with no luck.
If I search for libncurses.so.5 in my system I find 3 of them in different parts of the /snap directory. Maybe the program is not looking there? If so I don't no how to fix that.
I also found this advice:
root#examplehost ~]# ln -s /usr/lib64/libncurses.so.6.1 /usr/lib64/libncurses.so.5
So using that I tried to link one of the libncurses.so.5 files in /usr/lib/ and when that didn't work in /usr/lib64/ (I thought that was logical but I don't have a clue), still no luck.
Any advice on this would be greatly appreciated.
sudo apt-get install libncursesw5

Installation of Xdebug on MacOS Catalina 10.15

I tried to install Xdebug on OS X 10.15 and run into following problem:
/private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found
I tried to fix the problem like described here: Installing xdebug on MacOs Mojave - 'php.h' file not found
Unfortunately the header files cannot be found in this directory: /Library/Developer/CommandLineTools/Packages
Any ideas where I can get the current header files for OS X 10.15?
Update
For anyone that just want xdebug support on MacOS, most of the instructions in this answer are not necessary when using the built-in version of PHP. Before doing anything, you should check if xdebug.so already exists in /usr/lib/php/extensions/no-debug-non-zts-20180731/, which should be there by default. If so, you can skip to the Enabled support in PHP portion of this answer.
Using Homebrew is also an acceptable solution for you (and can also prevent other issues).
For anyone else looking to actually build binaries on MacOS and get the header error, the full answer is for you. It also answer OP question directly. Note building xdebug from source code and actually trying to use that version of xdebug.so with the build-in PHP should end up in a "code signature" error. As described here and here, the only real solution would be to compile and use you own instance of PHP instead of the built-in one. In any situation, using Homebrew would be easier.
tl;dr
Apple decided to remove headers file in /usr/include and the macOS_SDK_headers_for_macOS_10.14.pkg package. To install Xdebug, you'll have to manually compile Xdebug with the correct reference in both phpize and make.
For more details, I wrote a blog article about the issue and the solution
Original Answer:
Long story short, Apple decided to nuke /usr/include in MacOS Catalina, which has been the default location for C header file for ever in UNIX systems. Trying to install through PEAR / PECL will return an error as the compiler will look for necessary headers file in /usr/include. So the solution is to compile Xdebug manually, manually specifying the actual location of the header files, which are still provided by Xcode, just at a different location.
First, make sure Xcode is installed, including the command line tools. The following command will display the location of the default SDK :
$ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
The header you'll want (php.h) will then be in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/main.
Getting source
Let's compile 2.7.2, getting the source code from git. Alternatively, you can download the source from Xdebug site.
git clone https://github.com/xdebug/xdebug.git
cd xdebug
git checkout tags/2.7.2
phpize
Next we need to make a copy phpize so we can edit the include path :
cp /usr/bin/phpize .
nano ./phpize
Find this line :
includedir="`eval echo ${prefix}/include`/php"
...and replace it with this line :
includedir="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php"
Run phpize:
./phpize
You should now see something like this :
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
Configure & build
We can now configure :
./configure --enable-xdebug
...and run make using our custom SDK location defined as compiler flags :
make CPPFLAGS='-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/main -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/TSRM -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/Zend -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/ext -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/ext/date/lib'
Might see some warning, just ignore it for now. Finally, we'll need to run :
make install
Again, this command will fail because it can't move the extension to the right place. SIP will prevent it. But no worries, we'll take care of that manually at the next step. make install is still required as it will sign the *.so file.
Enabled support in PHP
Next, we move the executable somewhere safe. I use /usr/local/php/extensions.
sudo mkdir -p /usr/local/php/extensions
sudo cp /usr/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so /usr/local/php/extensions
Then we edit the PHP configuration to enable Xdebug. Simply edit php.ini:
sudo nano /etc/php.ini
And we add the following at the bottom :
[xdebug]
zend_extension=/usr/local/php/extensions/xdebug.so
xdebug.remote_enable=on
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
Restart built in server to be sure :
sudo apachectl restart
And finally test everything went fine :
php -i | grep "xdebug support"
If the above command returns nothing, then Xdebug is not available on your install. Go back the steps to find out what's missing.
Note:
A more complete fix would be to edit the result of php-config --include-dir, which returns /usr/include/php. That would make any installation find the necessary header files without having to manually edit files or compiler flags.
If you are using brew, I solve this by reinstalling php and re-linking:
brew reinstall php#7.3
brew link --overwrite php
I got an error when I tried to install xdebug in MacOS Catalina 10.15:
pecl install xdebug-3.0.1
Error:
/private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found
This is due to Apple decided to remove headers file in /usr/include, like you can see in other answer.
Then I added config to .bash_profile, executing these lines in console:
echo 'export PATH="/usr/local/opt/php#7.3/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php#7.3/sbin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/php#7.3/lib"
export CPPFLAGS="-I/usr/local/opt/php#7.3/include"
source ~/.bash_profile
After that you can try to install xdebug again with pecl:
pecl install xdebug-3.0.1
Notes: Previously I have installed PHP 7.3 with "brew". You should adjust the php and xdebug version, in the above lines, adding the versions that you prefer.
I would recommend you use "brew" to install PHP, and then use the "pecl" tool that comes with the installed version of brew's PHP to install Xdebug.
you can find detailed instructions with ready to use patches on this site: https://profilingviewer.com/installing-xdebug-on-catalina.html

macOS "./configure: No such file or directory" problem

When I try to install Sphinx with this guide
./configure --with-pgsql --with-mysql #from guide
make #from guide
sudo make install #from guide
./configure
-bash: ./configure: No such file or directory
$ autoreconf --install
autoreconf: 'configure.ac' or 'configure.in' is required
Are you running the ./configure command within the Sphinx source code folder? These instructions are for compiling Sphinx.
It's worth noting that the latest (v3.x) Sphinx releases aren't available as source code, only as pre-compiled binaries. So if that's what you've downloaded, you'll want to copy the files in ./bin - which would include indexer and searchd - into a location within your PATH (I would suggest /usr/local/bin).
Not excellent solution (because without mysql), but working (as all in programming world).
1) brew remove mysql
2) brew install mysql#5.7 (I don't know why, but it is working only with this version)
3) download sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz and extract and cd to it
4) ./configure --with-pgsql --without-mysql and make and sudo make install
It is working for me, because I need postgresql first of all

Problem with gcc 4.6 installation on ubuntu

I am trying to install gcc 4.6 (mainly for having C++0x better supported) in my ubuntu 9.10 (via virtualbox). I referred to previous questions, but I am getting a different error.
I am referring this link for the installation. Now, I have done till the ./gcc-xx/configure ... step. Though it was giving some flex package related error. Mostly due to that make is also failing with below errors:
build/gengtype.o: In function
adjust_field_rtx_def':
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:978:
undefined reference tolexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1032:
undefined reference to lexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1042:
undefined reference tolexer_line' ...............
Now this is giving me a hard time figuring it out because I have already flex/bison latest versions installed. I searched over internet for 2 days almost but no luck. Any help would be really appreciated. Also note that, I already have gcc 4.4 installed in /usr/bin/gcc and I have unzipped the gcc 4.6 tar in my home directory local folder.
[Note: I am also ok with installing ubuntu 11.10 too (which has gcc 4.6) as last resort. But I don't know if its .iso image is available.]
I got this fixed. I followed following procedure:
[Note: run all the commands with sudo, if you are not login as root. e.g. sudo ls -ltr; sudo make install;
As mentioned in the link in my
question, download the gcc4.6...tar
file in a temporary place
Now find the place where current
gcc is stored. e.g. My earlier
gcc4.4 was stored in
/usr/lib/gcc/i486-linux-gnu. Which
has a folder called 4.4, 4.4.1
Create a folder named 4.6 (or
4.6.1/2/3 etc.) and put that
.tar file inside it. Untar the
file as shown in link.
Follow all the procedure as per the
link. Use nohup <command> & to
track the logs. i.e. nohup make
clean all & followed by tail -f
nohup.out
If some error comes, it means some
package is missing. Mostly those
package will be present in your
current gcc version. You can
install them there itself. For
example, in my case zlib was
missing. I ran sudo apt-get install
zlib1g-dev libssl-dev and it worked
fine. Otherwise download from internet and install it.
Once your gcc is installed, you
can simply check it using type
gcc-4.6. In my case it showed that
it's stored as
/usr/local/bin/g++-4.6.
Either you can use the same path to
compile or you can put an alias in
your bash/tcsh/ksh. e.g.
/usr/local/bin/g++-4.6 -std=c++0x
-Wall test.cpp
FWIW Debian testing and unstable have gcc-4.6 as a standard package. So you can simply install that distro inside of virtualbox or, as I've done on my Ubuntu 11.04 server at home, via kvm. In the past, I also used to use dchroot build environments.
There may also be prepackaged gcc-4.6 binaries at launchpad.

problems at installation of sphinx on mac osx - can't even do the ./configure command

I tried to install sphinx on my Mac (OSX 10.6.7) but at the first installation step, I run into a problem.
According to the installation doku, http://sphinxsearch.com/docs/current.html#installation, one should do the following steps
$ ./configure
$ make
$ install
When I enter ./configure in my terminal, I get the following error message:
$ ./configure
> -bash: ./configure: No such file or directory
So I looked in the folder 'sphinx-2.0.1-beta-osx10.6-i386' and saw that there's no such file such as configure. Also
$ ls -a
> . api doc sphinx-min.conf.in
.. bin example.sql sphinx.conf.in
COPYING contrib log
INSTALL data sphinx-min.conf
When I tried other files such as sphinx-min.conf, I get
$ ./sphinx-min.conf
$ -bash: ./sphinx-min.conf: Permission denied
Also the sudo ./sphinx-min.conf doesn't work
$ sudo ./sphinx-min.conf
$ sudo: ./sphinx-min.conf: command not found
Any ideas?
It seems possible that you have downloaded a binary version, rather than the source code. You should check for binaries in the subdirectory bin.
You should also read the file INSTALL, which probably has installation instructions that go with the distribution you have downloaded.
You should download Source tarball (tar.gz) from http://sphinxsearch.com/downloads/release/ even it has the deceptive linux-penguin icon. After decompression the tarball you can follow the installation steps as http://pat.github.com/ts/en/installing_sphinx.html says.

Resources