I'm trying to allow my heroku wordpress install to be able to write files heroku. To do this, I'm trying to install zlib. Fortunately, I got referred to a section of the tutorial on this, but I'm having some trouble. The tutorial tells me to run the following in heroku bash :
heroku run bash
export PS1="\u#\h \w> "
mkdir tmp
cd tmp
git clone https://github.com/php/php-src.git -b PHP-5.3
cd php-src
cd ext/zlib
/app/php/bin/phpize
./configure –with-php-config=/app/php/bin/php-config
make
cd modules
scp zlib.so user#host:~/destination
exit
I'm stuck at
cd ext/zlib
/app/php/bin/phpize
./configure –with-php-config=/app/php/bin/php-config
I'm presuming he means to cd to /ext/zlib/app/php/bin/phpize
I can cd all the way to /bin, but I can't seem to cd to phpize. if I type "dir", I do see something called phpize in the terminal.
What would I need to run to execute the command above? Knowing that I'm currently on the directory /ext/zlib/app/php/bin
phpize is a utility program. Install php-devel
Related
I'm trying to install a PHP Extension on my Linux Server however the installation process is confusing.
They provide this instructions.
git clone https://github.com/longxinH/xhprof.git ./xhprof
cd xhprof/extension/
/path/to/php7/bin/phpize
./configure --with-php-config=/path/to/php7/bin/php-config
make && sudo make install
I done git clone on PHP Extensions Folder
The thing that confuse me is
/path/to/php7/bin/phpize
Where is php7 bin?
The closest thing i found is /usr/bin/php
but its an executable file.
Inside this directory
/usr/bin/
I have php , php7.4, php-config, phpconfig7.4
I need SQLite minimum version 3.8 to support a MediaWiki install on Amazon EC2. Amazon Linux is based on CentOS and the latest version available in the yum repository is SQLite 3.7.17.
The downloads available from sqlite.org don't include 64-bit Linux. There is a GitHub repository that has a prebuilt 64-bit version, however it's only the command line version. I put it at /usr/bin:
$ which sqlite3
/usr/bin/sqlite3
$ sqlite3 --version
sqlite3: /lib64/libtinfo.so.5: no version information available (required by sqlite3)
3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9
But MediaWiki still complains I have SQLite 3.7.17 installed. When I test it I get:
$ cat x.php
<?php
print_r(SQLite3::version());
?>
Run it:
$ php7 x.php
Array
(
[versionString] => 3.7.17
[versionNumber] => 3007017
)
I am guessing this is because of these libraries:
$ sudo find / -name "libsqlite*"
/usr/lib64/libsqlite3.so.0
/usr/lib64/libsqlite3.so.0.8.6
How can I download/rebuild or otherwise install a later version of these SQLite libraries?
The easiest option I found was to build it myself. Tested on Amazon Linux release 2 (Karoo).
Download the latest source code with the configure script from here. Currently this is:
curl https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz | tar xzf -
Go into the created directory and create the Makefile with our system dependant options:
cd ./sqlite-autoconf-3320300 && ./configure
Build the binary
make
Install it
sudo make install
Clean up
cd .. && rm -r ./sqlite-autoconf-3320300
Note: It's far from ideal to do this without a proper RPM package. If you update sqlite through yum, you will overwrite you manually built version.
Adding on to #halbgut answer, with some changes:
Download the latest source code with the configure script from here. Currently this is:
curl https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz | tar xzf -
Go into the created directory and create the Makefile with our system dependent options:
cd ./sqlite-autoconf-3320300 && ./configure
Build the binary
make
Install it
sudo make install
Now, you have created the sqlite3 file. You need to replace them everywhere you find the file sqlite3.
To find all these places - run the following command:
whereis sqlite3
sqlite3: /usr/bin/sqlite3 /usr/local/bin/sqlite3 /usr/include/sqlite3.h /opt/c9/bin/sqlite3 /usr/share/man/man1/sqlite3.1.gz
Now within the sqlite source folder ./sqlite-autoconf-3320300, find the sqlite3, sqlite3.h files and replace with the following cp command
sudo cp sqlite-autoconf-3320300/sqlite3 /usr/local/bin/sqlite3
sudo cp sqlite-autoconf-3320300/sqlite3 /usr/local/bin/sqlite3
sudo cp sqlite-autoconf-3320300/sqlite3 /opt/c9/bin/sqlite3 {I am using c9, hence this file, figure out what file is in the opt/ dir)
sudo cp sqlite-autoconf-3320300/sqlite3.h /usr/include/sqlite3.h
Once done, you would have upgraded both env and python-env. Now you need to just define the path to it. For it, use the local/lib in usr.
export LD_LIBRARY_PATH="/usr/local/lib"
Now you should have this :
$ python -c "import sqlite3; print(sqlite3.sqlite_version)"
3.23.3
$ sqlite3 --version
3.32.3
If you just need the sqlite3 binary, the SQLite amalgamation also works perfectly on Amazon Linux 2. For SQLite 33.9.04 (or others from the SQLite Download section):
wget "https://www.sqlite.org/2022/sqlite-amalgamation-3390400.zip"
unzip "sqlite-amalgamation-3390400.zip"
cd "sqlite-amalgamation-3390400"
gcc shell.c sqlite3.c -lpthread -ldl -lm -o sqlite3
And then use it as you would any other software compiled from source:
ln -n ./sqlite3 ${wherever}/sqlite3
export PATH="${wherever}:$PATH"
SQLite docs give a good explanation of further options if you need them.
Get the latest sqlite3 download link from https://www.sqlite.org/download.html
and update the link given in the WGET bash command example shown below.
Example:
wget https://www.sqlite.org/2022/sqlite-tools-linux-x86-3400000.zip
unzip sqlite-tools*.zip
cd sqlite-tools*
sudo cp sql* /usr/local/bin/ # Usually this directory is empty, so no need to worry about overwriting files
cd ~
sudo yum update -y
sudo amazon-linux-extras install epel -y
sudo yum install glibc.i686 -y
sqlite3 --version
I'm new in installing packages on server. On php.net it says how you can install rar package by hand (http://www.php.net/manual/en/rar.installation.php):
gunzip rar-xxx.tgz
tar -xvf rar-xxx.tar
cd rar-xxx
phpize
./configure && make && make install
I've downloaded the package and uploaded it to server. My question is, WHERE do I need to write the installation commands? I've tried in CMD but, of course, it doesn't work. Help? :)
You need SSH access to the Linux machine you want to install this on. By the sound of your comments you either don't have SSH access (shared hosts) or don't know how to use it.
If you have SSH access to the server you're working on use a program like PuTTY to establish an SSH connection to the server. Once you've logged in with your SSH credentials type these commands:
cd /tmp
wget http://pecl.php.net/get/rar-3.0.1.tgz
gunzip rar-3.0.1.tgz
tar -xvf rar-3.0.1.tar
cd rar-3.0.1
phpize
./configure && make && make install
Is there any documentation about V8JS?
Do I need only standard PHP or some extensions to use V8JS?
I'll be very thankful for any information about V8JS in PHP.
Requirements
PHP 5.3.3+ and V8 library and headers installed in proper paths.
Install
I've found this docs on the v8js class.
The docs out there aren't complete or are not updated. I'm actually currently in the process of doing v8JS myself and it took me a few days to get the back end libs sorted out. First off, you must know that you can't do this is you have python < 2.7
Here is my install notes that I'm putting together for our dev vagrant boxes running centos 7.
cd /tmp
# Install depot_tools first (needed for source checkout)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
# Download v8
fetch v8
cd v8
# Build (disable snapshots for V8 > 4.4.9.1)
make native library=shared snapshot=off -j8
# Install to /usr
sudo mkdir -p /usr/lib /usr/include
sudo cp out/native/lib.target/lib*.so /usr/lib64/
sudo cp -R include/* /usr/include
echo -e "create /usr/lib64/libv8_libplatform.a\naddlib out/native/obj.target/tools/gyp/libv8_libplatform.a\nsave\nend" | sudo ar -M
cd /usr/lib64
sudo chrpath -r '$ORIGIN' libv8.so
========================
Compile php-v8js itself
========================
cd /tmp
git clone -b master https://github.com/phpv8/v8js.git
cd v8js
phpize
./configure
make
make test
sudo make install
sudo service httpd restart
A note on the line make native library=shared snapshot=off -j8. I had the compile stop on me a couple times, I just restarted it. I'm not sure why it stopped, but it restarted just fine and completed just fine.
After that is done, you need to create the php extension file /etc/php.d/v8js.ini with the following content
; Enable v8js extension module
extension=v8js.so
Run the following to make sure it is installed correctly
php -r "phpinfo();" | grep v8js
If you get output back and no errors you're good to go.
I have an application that works pretty well in Ubuntu, Windows and the Xandros that come with the Asus EeePC.
Now we are moving to the Acer Aspire One but I'm having a lot of trouble making php-gtk to compile under the Fedora-like (Linpus Linux Lite) Linux that come with it.
I managed to get all components needed for Phoronix test suite installed on Fedora but still have one issue.
# phoronix-test-suite gui
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/usr/bin/phoronix-test-suite: line 28: [: /usr/share/phoronix-test-suite: unary operator expected
You need two packages that aren't in Fedora, php-gtk, but php-gtk also has it's dependency - pecl-cairo
php-gtk needs to be downloaded from svn because tar.gz version is really old and doesn't work with php 5.3
Here is how I got all components built.
su -c "yum install php-cli php-devel make gcc gtk2-devel svn"
svn co http://svn.php.net/repository/pecl/cairo/trunk pecl-cairo
cd pecl-cairo/
phpize
./configure
make
su -c "make install"
cd ..
svn co http://svn.php.net/repository/gtk/php-gtk/trunk php-gtk
cd php-gtk
./buildconf
./configure
make
su -c "make install"
cd ..
wget http://www.phoronix-test-suite.com/download.php?file=phoronix-test-suite-2.8.1
tar xvzf phoronix-test-suite-2.8.1.tar.gz
cd phoronix-test-suite
su -c "./install-sh"
So please take where I left to get Phoronix test suite running on Fedora.
Hi Guys well I finally got this thing to work the basic workflow was this:
#!/bin/bash
sudo yum install yum-utils
#We don't want to update the main gtk2 by mistake so we download them
#manually and install with no-deps[1](and forced because gtk version
#version of AA1 and the gtk2-devel aren't compatible).
sudo yumdownloader --disablerepo=updates gtk2-devel glib2-devel
sudo rpm --force --nodeps -i gtk2*rpm glib2*rpm
#We install the rest of the libraries needed.
sudo yum --disablerepo=updates install atk-devel pango-devel libglade2-devel
sudo yum install php-cli php-devel make gcc
#We Download and compile php-gtk
wget http://gtk.php.net/do_download.php?download_file=php-gtk-2.0.1.tar.gz
tar -xvzf php-gtk-2.0.1.tar.gz
cd php-gtk-2.0.1
./buildconf
./configure
make
sudo make install
If you want to add more libraries like gtk-extra please type ./configure -help before making it to see the different options available.
After installing you'll need to add php_gtk2.so to the Dynamic Extensions of /etc/php.ini
extension=php_gtk2.so
Sources:
[1]: Dependency problems on Acer Aspire One Linux
If you could give us more to go on than just trouble making it compile; we might be better able to help you with your issues.