PHP Installation fails in sapi/cli/php - php

...
...
"_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.

Related

Adding php-curl in a Yocto build

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

Failing installation while installing php-libgit2 php

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.

java error with Jenkins for PHP development - FATAL: com/google/inject/Module

I have set up a continuous integration environment for PHP using Jenkins on Ubuntu 12.04. I have most of the PHP tools bedded down and being successfully invoked,
However, all my builds are resulting in a Java error.
My searching on the 'Net is not yielding an positive results. The error seems to point to some library perhaps that is not loaded, but I cannot say which one.
Has anyone managed to setup with Jenkins and gone past this error? Any advise will be appreciated.
EDIT: I'm getting closer. I now understand that I could either using Maven or Phing (or Ant). My installation uses Phing, so I suppose I don't need Maven. My question is now how to not use Maven, and use Phing instead.
FATAL: com/google/inject/Module
java.lang.NoClassDefFoundError: com/google/inject/Module
at org.jenkinsci.plugins.xunit.XUnitProcessor.getXUnitLogObject(XUnitProcessor.java:94)
at org.jenkinsci.plugins.xunit.XUnitProcessor.performXUnit(XUnitProcessor.java:50)
at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:88)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:692)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:667)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:645)
at hudson.model.Build$RunnerImpl.post2(Build.java:161)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:614)
at hudson.model.Run.run(Run.java:1400)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:175)
Caused by: java.lang.ClassNotFoundException: com.google.inject.Module
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 13 more
UPDATE:
I located the jenkins log file, and saw this message at startup.
INFO: Started initialization
Mar 07, 2014 6:10:11 AM jenkins.model.Jenkins$6 onAttained
INFO: Listed all plugins
Mar 07, 2014 6:10:23 AM jenkins.model.Jenkins$6 onTaskFailed
SEVERE: Failed Loading plugin violations
java.io.IOException: Dependency maven-plugin (1.399) doesn't exist
at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:424)
at hudson.PluginManager$2$1$1.run(PluginManager.java:284)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:797)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Solved:
I have resolved this issue, with Simon's help.
The error was due to the fact that the Phing plugin was not installed. I assumed that installing Phing was sufficient.
To resolve this, I re-installed, this time following the instructions here:
http://systemsarchitect.net/continuous-integration-for-php-with-jenkins/
The error message looks like you chose maven for your build in the project configuration. First of all you need to install the jenkins phing plugin. After that you can replace the maven build step with the phin one ("invoke phing target").

Updating PHP in fedora Instance on AMAZON EC2

I have a fedora Instance runnig in an Amazon EC2. The problem is, I have a php already installed, but I want to update (PS: Somebody already gave to me the instance with the php installed). When I try the command: yum update php an error message appears.
Setting up Update Process
Setting up repositories
Cannot find a valid baseurl for repo: updates-released
Error: Cannot find a valid baseurl for repo: updates-released
I tried to uncomment the baseurl line in the yum repositorie files, but a new error appears.
Setting up Update Process
Setting up repositories
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Trying other mirror.
Cannot open/read repomd.xml file for repository: updates-released
failure: repodata/repomd.xml from updates-released: [Errno 256] No more mirrors to try.
Error: failure: repodata/repomd.xml from updates-released: [Errno 256] No more mirrors to try.
The error that you are getting sounds like it's a connection or DNS related issue -- see if you can ping 'download.fedora.redhat.com,' then see if you can use wget to attempt to get the file.
Also, your /etc/yum.repos.d/ directory may contain a repository file with an invalid repository in it -- I'm not sure if they're still publishing updates for Fedora 4 (it was released around 2004ish). Your best bet is to make sure that the version in /etc/fedora-release matches with the version in that repository configuration file.

FOSRest gives fatal error in symfony 2

i am trying to install FOSRest & FOSRestBundle
initially , i have specified following settings in the deps
[FOSRest]
git=git://github.com/FriendsOfSymfony/FOSRest.git
target=fos/FOS/Rest
[FOSRestBundle]
git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
target=bundles/FOS/RestBundle
But that cause me into following error when i access http://localhost/Symfony/web/app_dev.php/
Fatal error: Declaration of
FOS\RestBundle\Routing\Loader\RestRouteLoader::setResolver() must be
compatible with that of
Symfony\Component\Config\Loader\LoaderInterface::setResolver() in
/home/logicase/public_html/Symfony/vendor/bundles/FOS/RestBundle/Routing/Loader/RestRouteLoader.php
on line 29
After that i tried following setting to make to the master branch and above error remains the same
[FOSRest]
git=git://github.com/FriendsOfSymfony/FOSRest.git
target=fos/FOS/Rest
version=origin/2.0
[FOSRestBundle]
git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
target=bundles/FOS/RestBundle
version=origin/2.0
and now when i run php ./bin/vendors install
i get following message in console.
Installing/Updating FOSRest 5eb800bd63ba84e5fc7028386cb66373bc3efafc fatal: ambiguous argument 'origin/2.0': unknown revision or path not
in the working tree. Use '--' to separate paths from revisions
Installing/Updating FOSRestBundle c11ab9d990a1e0e979b1c8ab72cc9793b4b2dcb5 fatal: ambiguous argument
'origin/2.0': unknown revision or path not in the working tree.
I tried following settings for FOSRest which solved my problem for symfony 2
[FOSRest]
git=git://github.com/FriendsOfSymfony/FOSRest.git
target=fos/FOS/Rest
version=origin/0.6
[FOSRestBundle]
git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
target=bundles/FOS/RestBundle
As you can see, there is no 2.0 branch : https://github.com/FriendsOfSymfony/FOSRestBundle/branches https://github.com/FriendsOfSymfony/FOSRest/branches The installation documentation does not talk about it. You should just remove the version lines.

Categories