Trouble with custom libevent package while building hiphop - php

I'm having trouble building hiphop under Backtrack 5. I have installed all the essentials and apparently the only part that it keeps failing at is the custom libevent package.
Here are the commands I'm running in order to build and install libevent.
wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar -xzvf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
cp ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff .
patch -p1 < libevent-1.4.14.fb-changes.diff
./configure --prefix=$CMAKE_PREFIX_PATH
make
make install
When building libevent it builds and installs with no errors. When attempting to build hiphop these are the commands I am running:
cd hiphop-php
git submodule init
git submodule update
cmake -D CMAKE_PREFIX_PATH=`/bin/pwd`/../ .
However when running CMAKE I get this error:
CMake Error at CMake/HPHPFindLibs.cmake:65 (message):
Custom libevent is required with HipHop patches
Does anyone know a way to fix this problem or at least point me in the right direction?
EDIT:
I forgot to mention this, but every time I attempt to patch the libevent source I get this message:
patch -p1 < libevent-1.4.14.fb-changes.diff
patching file event.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Here I usually just answer yes and allow it to proceed

I had the same problem for a while.
Following the steps above surely installs the libevent correctly.
Although the site in not clear, this error may be caused by misdirecting the cmake path.
For example, I saved hiphop in the following path: /dev/, and the libevent in the path: /.
So, I had to set the following:
CMAKE_PREFIX_PATH=/

Related

Docker container fails to build when installing GRPC

I have a Dockerfile that when used with my docker-compose commands works fine, I'd like to have this docker container built however as GRPC takes 15 mins to install every time I want to run tests in GitHub Actions
This is what my Dockerfile currently looks like:
FROM xxx-base:6
RUN pecl install grpc \
&& docker-php-ext-enable grpc \
WORKDIR /application
And I get the following error output:
#5 580.4 g++: fatal error: Killed signal terminated program cc1plus
#5 580.4 compilation terminated.
#5 580.4 make: *** [Makefile:248: src/core/ext/filters/client_channel/lb_policy/xds/cds.lo] Error 1
#5 580.5 ERROR: `make' failed
------
executor failed running [/bin/sh -c sudo pecl install grpc && docker-php-ext-enable grpc WORKDIR /application]: exit code: 1
It's worth mentioning in the base container used here I used pecl to install imagik so I know that command at least partially works. This is a base PHP 7.4 container.
Any suggestions, I've seen some other posts referring to the memory limit on the docker build, but I'm not sure what to change
Pastebin full stacktrace: pastebin.com/g7iZ2uRn
Installing GRPC in a pipeline takes a long time.
I recommend using the cache of the provider used (bitbucket, github etc ..) or using a base image which is used as the starting point of the Dockerfile
FROM baseimage:latest
I have implemented an image based on alpine and php 7.4 with extension grpc installed, check it on github gits click here
In case gcc –version says anything less than 4.9 ...this might be the cause.
This answer also seems to be related to your scenario... in case PECL fails.

Why cant I run bin/behat?

I am trying to run behat on my vendor folder. I have installed composer globally, have installed the behat package, but every time I run bin/behat I keep getting this message from composer
You must set up the project dependencies, run the following commands:
curl -s http://getcomposer.org/installer | php
php composer.phar install
I am not sure how to fix this. I see the files are in the vendor folder, and when I type "composer" on the terminal, I see the manual.
If anyone can help me resolve this I would really appreciate it. Thanks!
There are several possible problems leading to this situation:
Make sure that composer is installed in your $PATH. That is, running composer at a command prompt should work, and you shouldn't need to run an explicit path like ~/Downloads/composer.phar
Execute the composer install instruction as the error message suggests. A common error is the message
Mcrypt PHP extension required
in which case you need to install the specified extension. For example, brew install php56-mcrypt on a Mac or sudo apt-get install php5-mcrypt on Ubuntu.

Install Specific PHP Version with Puppet & Vagrant

First time puppet user, and I'm having trouble getting an install of a specified version of PHP using Vagrant. I'm using the example42/php module, and I keep running into ensure problems.
Error: Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install php-5.5.12' returned 1: Error: Nothing to do
Error: /Stage[main]/Php/Package[php]/ensure: change from absent to 5.5.12 failed: Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install php-5.5.12' returned 1: Error: Nothing to do
Warning: /Stage[main]/Php/File[php.conf]: Skipping because of failed dependencies
spits out of my console, followed by another attempt that's identical.
My .pp file I'm provisioning with:
class lamp {
# package {'php':
# ensure => present,
# }
}
node 'node1' {
include lamp
file { '/php':
ensure => directory,
# I read that I may need to have a directory in order for the install to work...
}
class { 'php':
version => '5.5.12',
}
}
As far as I can tell, I'm referencing correctly to the modules, which I store inside /puppet/modules/ and it's finding them, but I'm having a hard time getting a specific version of PHP to install. I could use a very simple "getting started LAMP" for Puppet but that only install 5.3.3 even if I ensure => latest,
The puppet module only uses your system's package manager (yum) to download specific php packages. If it cannot find the required packages, it will not work. 5.3.3 is latest version in your repository, so it install that. I wouldn't be surprised if this is the only version of php available in your repositories.
You need to configure yum with some repositories which have the required PHP packages and then try the puppet module with that.

Symfony2 : --reinstall issue

I have been trying to install Buzz for Symfony2. I added it to the deps file, and tried to update my vendors :
php bin/vendors update
The command simply tells me that I've installed the standard version, and that I should try to use :
php bin/vendors install --reinstall
instead. Which I did.
But then an error pops in and tells me :
Updating deps.lock
sh:/var/www/Symfony/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php: not found
PHP Fatal error: Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in /var/www/Symfony/app/autoload.php on line 37
PHP Fatal error: Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in /var/www/Symfony/app/autoload.php on line 37
And then nothing works anymore, which is not surprising because my vendors folder is almost empty.
Has anyone encountered this problem before? Any clue on how to fix it?
Edit :
I found out the origin of this error. I didn't have git installed, so I did :
sudo apt-get install git-core
Check this link for more info on that : http://comments.gmane.org/gmane.comp.php.symfony.symfony2/8239
However I'm having another error now ("Looked for namespace "buzz.client.curl", found none"). I'm making another thread for that one, as it is not the same problem (link here).
That's not the right way to update your vendors. Per the docs
There is also a php bin/vendors update command, but this has nothing
to do with upgrading your project and you will normally not need to
use it. This command is used to freeze the versions of all of your
vendor libraries by updating them to the version specified in deps and
recording it into the deps.lock file.
Ergo, all you need to do is run php bin/vendors install (I know, it's confusing. I partially blame them for poorly naming the sub-command)
EDIT
To help resolve your current issues, try these steps
rm -rf vendor/*
rm -rf app/cache/*
rm app/bootstrap.php.cache
php bin/vendors install
Hope it works
Try to remove everything from "vendor" folder and run
php bin/vendors install
command
Before you add in deps file copy all the content of deps file in any of your text editor,then delete all your contents of deps and add the Buzz link in deps only.
Then try the below command
php bin/vendors install --reinstall
this will install the BUZZ bundle safely. After installing BUzz bundle you can paste all the deps content that you have copied earlier.
If you are trying this make sure to download new symfony project and try this.
May be this will helps you. I tried it earlier on one of my project.

How do I use terminal to install plugins and libraries for PHP (MAMP)?

Can you walk me through the installation of a library for php, specifically what each terminal command does?
I have been learning web development for 6 months and it is time I need the console / terminal. I can't find any beginner walkthrough of using the terminal to add libraries and plugins to PHP. There are a lot of tutorials for specific steps or errors, but none start to finish.
If you want specifics to make your example concrete, here is what I am trying to install:
The library I am installing: http://code.google.com/p/phpquery/.
My directory for PHP on MAMP: /Applications/MAMP/bin/php/php5.3.6/bin
Thanks!
Don
edit:
I figured out my specific issue, but I don't think I really understand what I did, so I can't repeat it by myself in any other situation. This thread can help a lot of new terminal users including myself. The type of response I am looking for would go like this:
Step 1: Open your terminal. (This is an alternative way to navigate and execute commands on files on your computer).
Step 2: Find out where MAMP is installed however you like. Then go to your terminal, and type in cd followed by the path. cd stands for current directory and tells your terminal where it should execute its commands. The command you use will be very similar to this cd /Applications/MAMP. This will make your current directory MAMP.
Step 3: You are adding a library to PHP. So you need to go to the PHP folder in MAMP.... (please help us from this part!)
I just checked and it is available in pear channels.
# this is from their site
pear channel-discover phpquery-pear.appspot.com
pear install phpquery/phpQuery
Of course, for Mac using MAMP, you would use commands like this:
/Applications/MAMP/bin/php5/bin/pear install [package]
So for PHPQuery, try this:
/Applications/MAMP/bin/php5/bin/pear channel-discover phpquery-pear.appspot.com
/Applications/MAMP/bin/php5/bin/pear install phpquery/phpQuery
Same method should apply to pecl extensions as well.
EDIT
I personally just installed it on mine to test, here were my results:
$ /Applications/MAMP/bin/php5/bin/pear channel-discover phpquery-pear.appspot.com
Adding Channel "phpquery-pear.appspot.com" succeeded
Discovery of channel "phpquery-pear.appspot.com" succeeded
$ /Applications/MAMP/bin/php5/bin/pear install phpquery/phpQuery
downloading phpQuery-0.9.5.386-pear.tgz ...
Starting to download phpQuery-0.9.5.386-pear.tgz (100,990 bytes)
......................done: 100,990 bytes
install ok: channel://phpquery-pear.appspot.com/phpQuery-0.9.5.386
This should work with any PEAR or PECL extension. Check out this page for a list of PEAR packages.
EDIT 2
Make sure /Applications/MAMP/bin/php5/lib/php is in your include path! That is where phpQuery.php will be located once you've downloaded the PEAR packages properly with MAMP.
EDIT 3
Per cshu's comment, he mentioned that these packages are no longer maintained and that you should use this instead:
$ /Applications/MAMP/bin/php5/bin/pear channel-discover pear.querypath.org
$ /Applications/MAMP/bin/php5/bin/pear install querypath/QueryPath

Categories