I am trying to install libgit2 and php-git. I've successfully downloaded and built libgit2.However, I face problem when I try to install php-git.
This is how I try to install it :
phpize
./configure --enable-git2-debug
make
make install
There's no problem with phpize. However, when I use make and make install, following errors are showed:
./php_git2.h:180:3: error: unknown type name 'git_smart_subtransport'
git_smart_subtransport *smart_subtransport;
./helper.h:58:42: error: unknown type name 'git_checkout_opts'; did you mean 'git_checkout_options'?
void php_git2_git_checkout_opts_to_array(git_checkout_opts *opts, zval **out TSRMLS_DC);
/usr/local/include/git2/checkout.h:295:3: note: 'git_checkout_options' declared here
} git_checkout_options;
^~~~~~~~~~~~~~~~~
./helper.h:62:41: error: unknown type name 'git_checkout_opts'; did you mean 'git_checkout_options'?
int php_git2_array_to_git_checkout_opts(git_checkout_opts **out, zval *array TSRMLS_DC);
^~~~~~~~~~~~~~~~~
git_checkout_options
and there are more errors. Why this happens?
These errors indicate that the header files for libgit2 do not correspond to the version which the PHP bindings expect.
The bindings have their own libgit2 version which they link statically, so it does not need/want to use a system-installed version, but this is where the header files are being read from (as indicated by the paths in the output).
It looks to be a bug in php-git that it reads system header files for libgit2, but that's the root of the issue. The bindings do not want you to install libgit2 on your system. Unless you need a system libgit2 for another purpose, removing it should fix the issue.
You should file a bug with the php-git project as failing to work when a version of libgit2 is installed on the system is a build system bug in its code.
I should have been clearer. Looks like it's not finding libgit2.
Related
I've been building a custom image using Yocto and wpewebkit to use within docker. I need to run a local web server with php, which I have accomplished no problem. I need to use curl within my project and I have apache2, php, modphp, and curl installed. All I need is php-curl but I cannot find how to install this. Does anyone know how or if I can do this? I've put in all my efforts on googling multiple phrases but I only find how to install php-curl using apt-get or yum, or I get links to the meta-* directories which I have access to within my build files anyways.
If it helps at all, this custom image was based on the image provided from the following project on GitHub: https://github.com/resin-io-playground/resin-wpe/tree/master/base-image . I already spoke to the developer and their knowledge of PHP is limited.
EDIT #1: Progress so far, had to update the curl.bb file to properly include libcurl-dev, and then worked with #pmod's suggestion to incorporate curl into the php build. Everything seemed to run okay until I received the following error:
| ../php-7.1.9/configure: line 386: test: please: integer expression expected
| configure: error: reinstall
| ../php-7.1.9/configure: line 275: return: please: numeric argument required
| ../php-7.1.9/configure: line 285: exit: please: numeric argument required
| NOTE: The following config.log files may provide further information.
| NOTE: /base-image/build/tmp-glibc/work/x86_64-linux/php-native/7.1.9-r0/build/config.log
| ERROR: configure failed
| WARNING: /base-image/build/tmp-glibc/work/x86_64-linux/php-native/7.1.9-r0/temp/run.do_configure.29590:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_configure (log file is located at /base-image/build/tmp-glibc/work/x86_64-linux/php-native/7.1.9-r0/temp/log.do_configure.29590)
ERROR: Task (virtual:native:/base-image/build/../meta-openembedded/meta-oe/recipes-devtools/php/php_7.1.9.bb:do_configure) failed with exit code '1'
Edit #2: I've gone ahead and added everything I was missing. I'm getting the same error above, where the function do_configure during the php build is failing. I'm posting below what I ensured I have in my curl.bb file (I had to add this), what I have in my php.inc file, and the curl files located staging directory.
curl.bb:
PACKAGES =+ "lib${BPN} lib${BPN}-native lib${BPN}-dev lib${BPN}-dev-native"
FILES_lib${BPN} = "${libdir}/lib*.so.*"
FILES_lib${BPN}-dev = "${includedir} \
${libdir}/lib*.so \
${libdir}/lib*.a \
${libdir}/lib*.la \
${libdir}/pkgconfig \
${datadir}/aclocal \
${bindir}/*-config"
php.inc:
EXTRA_OECONF_append = " --with-curl=${libdir}/.."
DEPENDS_${PN} += "libcurl-dev libcurl-dev-native"
PHP Staging Directory:
/installeddeps/curl-native
/installeddeps/curl-native.b77f37db31cf2391919a12c5c9774bff
/installeddeps/curl-native.complete
/usr/share/aclocal/libcurl.m4
/usr/bin/curl-config
/usr/bin/crossscripts/curl-config
/usr/bin/curl
/usr/lib/pkgconfig/libcurl.pc
/usr/lib/libcurl.so
/usr/lib/libcurl.a
/usr/lib/libcurl.so.4.4.0
/usr/lib/libcurl.so.4
/usr/include/curl
/usr/include/curl/curl.h
/usr/include/curl/curlrules.h
/usr/include/curl/curlbuild.h
/usr/include/curl/curlver.h
/usr/include/curl/easy.h
According to php manual, PHP/cURL feature is enabled at php configuration stage with --with-curl=[dir] option.
I checked the main recipe include file php.inc and couldn't find such configuration option. So, try creating in your working layer php_%.bbappend file with (or add this directly to the bottom of php.inc to test):
EXTRA_OECONF_append_class-target = " --with-curl=${STAGING_LIBDIR}/.."
DEPENDS_append_class-target = " curl"
Note, that curl package among DEPENDS because it is needed at build stage.
I don't think you need to update curl recipe with PACKAGES and FILES, pkg_config should take care
I am trying to use the HttpRequest class which should be in the PECL_HTTP extension of php.
I have php5 and used the following to install pecl_http.
sudo pecl install pecl_http
pecl/pecl_http is already installed and is the same as the released version 2.0.1
install failed
After that i enter into my php.ini:
[PHP]
extension=http.so
[...]
Then i restart my apache2 server, and try using the HttpRequest class, but it gives me the following error:
PHP Fatal error: Class 'HttpRequest' not found
What are possible error's i might have missed?
UPDATE: (Changed the title)
The Extension is not shown in phpinfo(), i set
extension=http.so
And checked if the http.so file is in my extension_dir. I really don't know how to make php recognise the extension.
UPDATE 2:
I managed to install extension, but the class still does not exist.
For others, i had to reference the other extensions pecl_http needs. (For me: propro.so, raphfr.so)
UPDATE 3:
I did not manage to make the Class visible, the answers below show some approaches with other classes.
I solved this issue by using CURL.
You have installed the new version of the extension which uses a completely different API. I still don't know how it works, but I will update my answer one I know. The Documentation of the new version is to be found at http://devel-m6w6.rhcloud.com/mdref/http.
To Install the old version, first uninstall the new verion and then execute
pecl install http://pecl.php.net/get/pecl_http-1.7.6.tgz
UPDATE: here are two examples from the documentation, both should work well:
one request (can be found at http://devel-m6w6.rhcloud.com/mdref/http/Client/enqueue):
<?php
(new http\Client)->enqueue(new http\Client\Request("GET", "http://php.net"),
function(http\Client\Response $res) {
printf("%s returned %d\n", $res->getTransferInfo("effective_url"), $res->getResponseCode());
return true; // dequeue
})->send();
multiple requests (can be found at http://devel-m6w6.rhcloud.com/mdref/http/Client/once):
<?php
$client = new http\Client;
$client->enqueue(new http\Client\Request("HEAD", "http://php.net"));
$client->enqueue(new http\Client\Request("HEAD", "http://pecl.php.net"));
$client->enqueue(new http\Client\Request("HEAD", "http://pear.php.net"));
printf("Transfers ongoing");
while ($client->once()) {
// do something else here while the network transfers are busy
printf(".");
// and then call http\Client::wait() to wait for new input
$client->wait();
}
printf("\n");
while ($res = $client->getResponse()) {
printf("%s returned %d\n", $res->getTransferInfo("effective_url"),
$res->getResponseCode());
}
In both examples you can use $res->getBody() to return the body of the response.
I couldn't test these examples but I have heard of other people that they work.
I had the same problem and solved it by arrange the order in wich extensions are loaded in php.ini
All my other extensions was loaded using their own .ini files in /etc/php5/mods_available.
In my apache2 error.log I noticed that json_decode was needed by http.so to load.
I created a file for http (http.ini) and a symlink in /etc/php5/apache/conf.d with a higher prefix than json.
my http.ini
; configuration for php http module
; priority=50
extension=raphf.so
extension=propro.so
extension=http.so
use the new pecl_http.2.0.6 like this
new http\Message();
or extend in your own class as extends http\Message
I'm trying to install WSO2 WSF/PHP extension to use SOAP with WSSE.
I was having problems when I was compiling sources, I needed to checkout trunk (instead of tag 2.1) from their repository, couple of times I fixed php 5.4 compatibility issues in source codes, finally everything compiled successfully
But when I try to enable this extension I get an error:
user#centos:~/wsf$ php -i | grep "wsf"
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/wsf.so' - /usr/lib/php5/20100525+lfs/wsf.so: undefined symbol: rampart_context_set_prv_key in Unknown on line 0
/etc/php5/cli/conf.d/20-wsf.ini,
PWD => /home/user/wsf
_SERVER["PWD"] => /home/user/wsf
I did grep on sources and found this:
user#centos:~/wsf$ grep -r "rampart_context_set_prv_key" .
./src/.svn/text-base/wsf_policy.c.svn-base: rampart_context_set_prv_key(rampart_context, env, Z_STRVAL_PP(token_val));
./src/.svn/text-base/wsf_policy.c.svn-base: if (rampart_context_set_prv_key_type (rampart_context, env, AXIS2_KEY_TYPE_PEM) == AXIS2_SUCCESS)
Binary file ./src/modules/wsf.so matches
./src/wsf_policy.c: rampart_context_set_prv_key(rampart_context, env, Z_STRVAL_PP(token_val));
./src/wsf_policy.c: if (rampart_context_set_prv_key_type (rampart_context, env, AXIS2_KEY_TYPE_PEM) == AXIS2_SUCCESS)
Binary file ./src/.libs/wsf.soT matches
Binary file ./src/.libs/wsf.so matches
Binary file ./src/.libs/wsf_policy.o matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.so.0 matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.a matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.so.0.3.0 matches
Binary file ./wsf_c/rampartc/src/util/.libs/rampart_context.o matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.so matches
./wsf_c/rampartc/src/util/rampart_context.c:rampart_context_set_prv_key(rampart_context_t *rampart_context,
./wsf_c/rampartc/src/util/rampart_context.c:rampart_context_set_prv_key_type(rampart_context_t *rampart_context,
./wsf_c/rampartc/src/util/rampart_context.c:rampart_context_set_prv_key_password(rampart_context_t *rampart_context,
Binary file ./wsf_c/rampartc/src/util/rampart_context.o matches
./wsf_c/rampartc/include/rampart_context.h: rampart_context_set_prv_key(rampart_context_t *rampart_context,
./wsf_c/rampartc/include/rampart_context.h: rampart_context_set_prv_key_type(rampart_context_t *rampart_context,
./wsf_c/rampartc/include/rampart_context.h: rampart_context_set_prv_key_password(rampart_context_t *rampart_context,
So basically I found only 1 file, wsf_policy.c which uses rampart_context_set_prv_key, but includes looks correct, and I don't know how to solve it. Any ideas?
Same Problem. Solved in the same way as in Error when trying to run security examples in wsf/php 2.1:
sudo apt-get install gcc-4.4
and then configuring wsf/php by running
./configure CC=gcc-4.4
Follow the rest of the normal installation steps and it should work.
You can also check the wsf.so library to see if it has the rampart libs linked in it by doing
ldd /usr/lib/php5/20090626/wsf.so
Also, just in case you haven't found it yet, here are the steps to compile WSF using PHP 5.4
https://wso2.org/jira/browse/WSFPHP-477
In my installation, the symbol "rampart_context_set_prv_key" is defined in the library ${wsf.home}/lib/librampart.so which is directly accessible from wsf.so thank to RPATH variable.
I have an application with some memcached operations. I have installed php memcached extension version 2.0.1. from configure to make install everything went smoothly, no errors.
Now in my application I instantiate a memcached instance and When I run methods like addServer or get or set, everything runs fine. But when I fire getStats or getVersion I get this error
/usr/local/bin/php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/memcached.so: undefined symbol: zend_parse_parameters_none
Can anyone help me with this? Been stuck with this since entire yesterday.
Another strange observation is with NetBeans. I use version 7.0.1. When I create a memcache object I get the autocomplete when type in $memcObj-> but the same is not true when the object is of memcached. No autocomplete.
I believe zend_parse_parameters_none was introduced for the Zend API in 2008.
sh ~> git blame Zend/zend_API.h
...
11e5d2f2 (Zeev Suraski 2001-07-30 02:07:52 +0000 247) _zend_get_parameters_array_ex(param_count, argument_array TSRMLS_CC)
cc2b17d5 (Felipe Pena 2008-03-10 22:02:41 +0000 248) #define zend_parse_parameters_none() \
cc2b17d5 (Felipe Pena 2008-03-10 22:02:41 +0000 249) zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
58f88057 (Andrei Zmievski 2001-07-09 18:51:29 +0000 250)
I imagine your version of PHP is not compatible with PECL's Memcached extension, as your extensions directory has a timestamp before 2006-11-02 (no-debug-non-zts-20060613).
Ideally you would want to look into upgrading PHP. Else, try PECL's Memcache extension; which, does offer a stable version to match your PHP build.
...
...
"_xmlTextReaderNodeType", referenced from:
_zm_startup_xmlreader in php_xmlreader.o
"_xmlParseURIReference", referenced from:
__dom_get_valid_file_path in document.o
__xmlreader_get_valid_file_path in php_xmlreader.o
_zif_xmlwriter_open_uri in php_xmlwriter.o
"_valuePop", referenced from:
_dom_xpath_ext_function_php in xpath.o
_dom_xpath_ext_function_php in xpath.o
_dom_xpath_ext_function_php in xpath.o
_xsl_ext_function_php in xsltprocessor.o
_xsl_ext_function_php in xsltprocessor.o
_xsl_ext_function_php in xsltprocessor.o
"_xmlTextReaderConstXmlLang", referenced from:
_zm_startup_xmlreader in php_xmlreader.o
"_xmlGetNodePath", referenced from:
_zim_domnode_getNodePath in node.o
"_xmlTextReaderReadInnerXml", referenced from:
_zim_xmlreader_readInnerXml in php_xmlreader.o "_xmlTextWriterEndElement", referenced from:
_zif_xmlwriter_end_element in php_xmlwriter.o
_zif_xmlwriter_write_element_ns in php_xmlwriter.o
_zif_xmlwriter_write_element in php_xmlwriter.o
"_xmlRelaxNGFreeValidCtxt", referenced from:
__dom_document_relaxNG_validate in document.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
Whenever running make, I'm receiving this error. Tried "brew install php", tried compiling and installing from source. Any suggestions?
Had a similar issue, using make clean before make solved this error.
If you used the homebrew-php repo's PHP formula, it's a known issue. The configure seems to ignore the libxml2 configure we pass to it (which uses the homebrew libxml2 formula) and persists in using the system libxml2 instead.
Make sure to check the Issues in the repo above, and post them there as well so we can provide support.
For this issue, see: homebrew-php#33
I had the same problem make clean did the trick
on AIX , touch sapi/cli/php and rerun make command.