I am trying to install paypal adaptive accounts API using PHP.
I have set up the developer account, test accounts and app and tested the parameters via the paypal tool. Now I need to install the API on our test site.
I have used How to check if curlSSL is working properly
to ensure I have curl set up.
I followed the instructions here using the PHP tab. I am installing without composer so I connected via an SSL client and used the command as instructed.
curl
https://raw.github.com/paypal/adaptiveaccounts-sdk-php/stable-php5.3/samples/install.php
| php
However I think this repository has been moved and I tracked it down to here.
Meaning my command should be
curl
https://raw.githubusercontent.com/paypal/adaptiveaccounts-sdk-php/master/samples/install.php
| php
I may have found the wrong code because it will not install.
The error output is
composer not installed or 'useComposer' is set to false in install.php.
Running custom installation ...
Downloading adaptiveaccounts-sdk-php - v2.6.106
Downloading sdk-core-php - v1.4.3
Generating autoload file
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in - on line 340
I have checked the install file and the following lines
// Flag to control whether composer should be used for installation
$useComposer = false;
confirm that useComposer is set to false which makes me think I have found the wrong install file.
So does anyone know where the correct location is to point cURL?
Or am I doing anything else wrong? Note the install appears to try to run "custom installation" and fails with a memory error.
Part of this is solved. The install.php file had been removed accidentally .
So you can run
curl -k -L https://raw.github.com/paypal/adaptiveaccounts-sdk-php/stable-php5.3/samples/install.php | php
This gave me a further error
This install script only suppoorts namespace based SDK
So I was directed to a non-namespaced version of of the SDK
curl -k -L https://raw.github.com/paypal/adaptiveaccounts-sdk-php/blob/stable/samples/install.php | php
I then started to get
Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 71 bytes) in - on line 340
So goto fork the file so that you can edit it and assign at the top. I was successful with
ini_set("memory_limit","128M");
This will increase the maximum amount of memory available to PHP to 128 MB for the running script. It is a temporary setting and will only affect the script it is in.
Related
Cpanel - Centos 7.8
Update
Running dcrpm provides this error message:
2020-07-08 14:21:51,147 ERROR [rpmutil.kill_spinning_rpm_query_processes]: Found stale rpm process: (7042) /usr/bin/rpm -q --nodigest --nosignature --queryforma
2020-07-08 14:21:51,505 ERROR [dcrpm.run]: DB needs recovery
2020-07-08 14:21:55,982 WARNING [rpmutil.verify_tables]: Skipping table 'Obsolet ename', blacklisted
yum commands dont return anything and rebuilding the RPM database doesn't seem to change anything.
I seem to be having some issues with EasyApache 4 after loading a few PHP extensions on a custom profile. I can no longer load any of the profiles.
I am stuck on an infinite loop of Loading profiles ... & when trying to access PHP versions through MultiPHP manager Gathering PHP-FPM packages information ... again in an infinite loop. Not quite sure how I've screwed up this time.
All I wanted to do was enable Zip Archives. Is there a way to disable what was enabled without going through there? Or is there a way to remove that profile and the associated enabled extensions?
Apologies I am somewhat of a newbie to all of this so I have come to the community that has helped me endlessly as I learn webdesign and basic code
All I can see in the error log is:
*AH01630: client denied by server configuration: /home/X/public_html/php.ini**
More Information
After leaving it load for an hour or so this appeared:
*The YUM cache is incomplete. The system is updating the cache to repair the issue.*
*This operation can take a few minutes to complete (it is very network and disk i/o intensive). EasyApache 4 will be available as soon as possible ...*
The result of which after several hours was:
*YUM encountered errors outside of EasyApache 4. Log into the system via SSH to resolve them, or you can click the ‘Refresh’ button to rebuild the system‘s YUM cache.*
Note: One new plugin was also installed recently (Softaculous) which may have something to do with it as the manage plugin section also doesn't load ._.
Unfortunately it seems now that no yum commands are working. I did try to run the following with no result:
yum clean all
yum update
It appears the proverbial ship is sinking, I can't even access plugins now as i get the follow fatal error:
(XID gvtyx9) The system aborted the subprocess “/bin/rpm” (process ID “23078”) because it reached the timeout of 15 seconds. at /usr/local/cpanel/Cpanel/SafeRun/Object.pm line 546.
Cpanel::SafeRun::Object::die\_if\_error(Cpanel::SafeRun::Object=HASH(0x2a1a970)) called at /usr/local/cpanel/Cpanel/SafeRun/Object.pm line 538
Cpanel::SafeRun::Object::new\_or\_die("Cpanel::SafeRun::Object", "program", "/bin/rpm", "args", ARRAY(0x179bed0), "timeout", 15, "read\_timeout", ...) called at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 264
Cpanel::GenSysInfo::\_run\_with\_timeout("/bin/rpm", "--query", "--nosignature", "--nodigest", "--queryformat", "%{NAME} %{VERSION}\\\\n", "--file", "/etc/redhat-release") called at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 204
Cpanel::GenSysInfo::\_get\_rpm\_distro\_version\_arch() called at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 124
Cpanel::GenSysInfo::\_get\_new\_conf(HASH(0x2148000)) called at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 51
Cpanel::GenSysInfo::run() called at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 71
Cpanel::GenSysInfo::get\_rpm\_distro\_version() called at /usr/local/cpanel/Cpanel/Plugins.pm line 181
Cpanel::Plugins::\_do\_url\_variable\_substitution("[http://httpupdate.cpanel.net/cpanel-plugins-c\\$cp\_centos\_major](http://httpupdate.cpanel.net/cpanel-plugins-c\$cp_centos_major)"...) called at /usr/local/cpanel/Cpanel/Plugins.pm line 158
Cpanel::Plugins::get\_baseurls() called at /usr/local/cpanel/Whostmgr/Addons/RPM/Cache.pm line 170
Whostmgr::Addons::RPM::Cache::\_yum\_modules() called at /usr/local/cpanel/Whostmgr/Addons/RPM/Cache.pm line 102
Whostmgr::Addons::RPM::Cache::\_LOAD\_FRESH("Whostmgr::Addons::RPM::Cache") called at /usr/local/cpanel/Cpanel/CacheFile.pm line 234
Cpanel::CacheFile::load("Whostmgr::Addons::RPM::Cache") called at /usr/local/cpanel/Whostmgr/Addons/RPM/Cache.pm line 91
Whostmgr::Addons::RPM::Cache::load("Whostmgr::Addons::RPM::Cache") called at /usr/local/cpanel/Whostmgr/Addons/RPM.pm line 62
Whostmgr::Addons::RPM::get\_modules() called at whostmgr/bin/whostmgr2.pl line 2531
main::manage\_plugins("manage\_plugins") called at /usr/local/cpanel/Whostmgr/Dispatch.pm line 274
Whostmgr::Dispatch::\_do\_call("manage\_plugins", HASH(0x2145770), HASH(0x214a890)) called at /usr/local/cpanel/Whostmgr/Dispatch.pm line 172
Whostmgr::Dispatch::dispatch("manage\_plugins", 1, ARRAY(0x2147af8), HASH(0x214a890)) called at whostmgr/bin/whostmgr2.pl line 773
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
When I call yii2 migrate command(from console). I always get "Out of memory" message. In regular case php do not show this error, but when migration command.
# ./yii migrate
Yii Migration Tool (based on Yii v2.0.13-dev)
Out of memory
However PHP through Apache works absolutely fine. It's just on the CLI that I get this error. The machine is running CentOS release 6 and PHP 5.6. System memory is 6GB, that is enough to run command.
total used free shared buffers cached
Mem: 5971 1557 4413 128 119 440
-/+ buffers/cache: 998 4973
Swap: 0 0 0
Add:
I witnessed laravel artisan command also show that error.
I could not know what occurs this error finally. But when I re-installed php library from base, the error disappeared. This may help for you.
I searched everywhere but i really can't find anything. I am trying to run php artisan but it seems that it just doesn't work.
Specifically i run this command when i am connected through ssh :
/opt/cpanel/ea-php71/root/usr/bin/php artisan
It is the same with php artisan but i am choosing a specific php version (7.1.5). This command should normally show up the rest of artisan commands.
The error i get :
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted
(tried to allocate 4096 bytes) in
/home/username/laravel/vendor/composer/autoload_static.php on line
274
My hosting provider tried to increase the memory limit but nothing happened. I tried increasing it a lot through .php files too.
Also i have tried running composer install/update/clear cache/dump autoload.
Please ask for further information if needed,
Any ideas?
Try to check spelling in the php.ini file. That happened to me when I set memory_limit = 512MB (that is false) instead of memory_limit = 512M (wich is correct). For some reason php understood it as 2MB of memory.
I downloaded the Google App Engine SDK for PHP but I am having problems with the installation of the PHP interpreter. I downloaded the source code from the link given but when I try to compile php the command make terminates with this error:
/bin/bash /home/david/Google/appengine-php-master/php-src/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/jsonc/ -I/home/david/Google/appengine-php-master/php-src/ext/jsonc/ -DPHP_ATOM_INC -I/home/david/Google/appengine-php-master/php-src/include -I/home/david/Google/appengine-php-master/php-src/main -I/home/david/Google/appengine-php-master/php-src -I/home/david/Google/appengine-php-master/php-src/ext/date/lib -I/home/david/Google/appengine-php-master/php-src/ext/ereg/regex -I/libxml2 -I/home/david/Google/appengine-php-master/php-src/ext/sqlite3/libsqlite -I/home/david/Google/appengine-php-master/php-src/TSRM -I/home/david/Google/appengine-php-master/php-src/Zend -I/include -g -O2 -fvisibility=hidden -c /home/david/Google/appengine-php-master/php-src/ext/jsonc/json.c -o ext/jsonc/json.lo
In file included from ext/jsonc/json-c/json_inttypes.h:5:0,
from ext/jsonc/json-c/json_object.h:16,
from ext/jsonc/json-c/linkhash.h:16,
from ext/jsonc/json-c/json.h:22,
from /home/david/Google/appengine-php-master/php-src/ext/jsonc/json.c:34:
ext/jsonc/json-c/json_config.h:2:23: fatal error: ../config.h: No such file or directory
#include "../config.h"
^
compilation terminated.
Makefile:725: recipe for target 'ext/jsonc/json.lo' failed
make: *** [ext/jsonc/json.lo] Error 1
In fact there is no such config.h file in that directory so I can't understand how to solve this problem.
So I decided to search online the source code of PHP 5.4.19 and I compiled and installed it and everything worked. I followed all the other installation steps and everything worked.
Now if I start the server with the command
google_appengine/dev_appserver.py --php_executable_path=/usr/local/bin/php-cgi --php_gae_extension_path=/home/david/Google/appengine-php-extension-master/modules/gae_runtime_module.so my_app/
I get:
INFO 2016-03-25 15:04:19,209 sdk_update_checker.py:229] Checking for updates to the SDK.
INFO 2016-03-25 15:04:19,797 sdk_update_checker.py:257] The SDK is up to date.
INFO 2016-03-25 15:04:19,901 api_server.py:205] Starting API server at: http://localhost:51913
INFO 2016-03-25 15:04:19,907 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2016-03-25 15:04:19,909 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR 2016-03-25 15:04:21,270 php_runtime.py:348] The PHP runtime is not available
Traceback (most recent call last):
File "/home/david/Google/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 344, in new_instance
self._check_binaries(php_executable_path, gae_extension_path)
File "/home/david/Google/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 286, in _check_binaries
cls._check_gae_extension(php_executable_path, gae_extension_path, env)
File "/home/david/Google/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 241, in _check_gae_extension
ext_stdout))
_PHPEnvironmentError: "/usr/local/bin/php-cgi -m" returned an error [-6]
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.0.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/home/david/Google/appengine-php-extension-master/remote_api.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.0.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/home/david/Google/appengine-php-extension-master/remote_api.pb.cc".)
Accordingly to the message the problem should be in the version of libprotobuf9 library. I have that library installed in my system (ubuntu 15.04) and in fact the version is 2.6.1. But by following the installation steps I installed protoc-3.0.0-beta-2-linux-x86_64 and protobuf-3.0.0-beta-2 in /usr. So, why does appengine use the wrong version of the library?
I thought about removing libprotobuf9 from my system but if I run sudo apt-get remove libprotobuf9 the list of packages that need to be removed is very big and contains things like
gnome-bluetooth gnome-calculator gnome-contacts
gnome-disk-utility gnome-font-viewer gnome-keyring gnome-mahjongg gnome-mines gnome-orca gnome-power-manager gnome-screensaver
gnome-screenshot gnome-session-bin gnome-session-canberra gnome-sudoku gnome-system-log gnome-system-monitor gnome-terminal
to me it doesn't seem a good idea to remove them. What's the solution to my problem?