Mailchimp with cakephp - cakephp

I am download sample code from mailchimp site and copy paste in my c:/xampp folder now i am run the index.php file but i got following warning and error
Warning:
include(C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master/Vendor/pear-pear.cakephp.org/CakePHP\Cake\bootstrap.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master\webroot\index.php
on line 107
Warning: include(): Failed opening
'C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master/Vendor/pear-pear.cakephp.org/CakePHP\Cake\bootstrap.php'
for inclusion (include_path='.;C:\xampp\php\PEAR') in
C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master\webroot\index.php
on line 107
Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to
the directory containing your \cake core directory and your \vendors
root directory. in
C:\xampp\htdocs\Dropbox\Demos\mailchimp\mcapi2-php-examples-master\webroot\index.php
on line 114
Now I am install composer and create phar file and try to update with composer update command but following error display
http://prntscr.com/5d2cgw

In composer.json file change require property with this lines
"require": {
"cakephp/cakephp": "2.5.*",
"mailchimp/mailchimp": ">=2.0.0"
},

Related

Google Cloud Storage file upload error in Google App Engine standard running PHP 7

I have a PHP 7 app built using the Google App Engine standard environment, and I want to be able to upload files and store them in Google Cloud Storage. I am using the Blueimp jQuery File Upload plugin to handle the uploading of files.
I am getting a number of errors. There is an error message saying failed to open stream: Read-only file system. These are the error messages:
Warning: move_uploaded_file(/srv/c/server/php/files/cats.png): failed to open stream: Read-only file system in /srv/c/server/php/UploadHandler.php on line 1152
Warning: move_uploaded_file(): Unable to move '/tmp/phpsKIIYL' to '/srv/c/server/php/files/cats.png' in /srv/c/server/php/UploadHandler.php on line 1152
Warning: filesize(): stat failed for /srv/c/server/php/files/cats.png in /srv/c/server/php/UploadHandler.php on line 322
Warning: unlink(/srv/c/server/php/files/cats.png): Read-only file system in /srv/c/server/php/UploadHandler.php on line 1171
Warning: Cannot modify header information - headers already sent by (output started at /srv/c/server/php/UploadHandler.php:1152) in /srv/c/server/php/UploadHandler.php on line 1201
{"files":[{"name":"cats.png","size":false,"type":"image\/png","error":"File upload aborted","deleteUrl":"https:\/\/myproject.appspot.com\/c\/server\/php\/index.php?file=cats.png","deleteType":"DELETE"}]}
Can someone please explain what I am doing wrong?
This is sample code to upload an object to your bucket php:
use Google\Cloud\Storage\StorageClient;
//create a bucket
$storage = new StorageClient();
$bucket = $storage->bucket('my_bucket');
//upload file
$source = 'path_to_file'
$file = fopen($source, 'r');
$objectName = 'my_file'
$object = $bucket->upload($file, [
'name' => $objectName
]);

Using wagtail start mysite returns syntax error

I am using pip, virtualenv and Python 3 to install wagtail. I am working on Ubuntu.
To backtrack a bit:
I was trying to install initially and got this error:
unicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 47: ordinal not in range(128)
I fixed this by changing my env to use Python 3.
This allows wagtail to start installing, but returned this list of errors while installing:
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/feedgenerator.py'...
File "/home/ubuntu/workspace/env/build/Django/django/utils/feedgenerator.py", line 82
**kwargs,
^
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/functional.py'...
File "/home/ubuntu/workspace/env/build/Django/django/utils/functional.py", line 12
return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs})
^
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/log.py'...
File "/home/ubuntu/workspace/env/build/Django/django/utils/log.py", line 229
)
^
SyntaxError: invalid syntax
*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/tree.py'...
l File "/home/ubuntu/workspace/env/build/Django/django/utils/tree.py", line 76
return hash((self.__class__, self.connector, self.negated, *make_hashable(self.children)))
^
SyntaxError: can use starred expression only as assignment target
It gave me a success message despite the syntax errors.
Successfully installed wagtail html5lib Django six Unidecode draftjs-exporter djangorestframework django-taggit pytz django-modelcluster Willow Pillow beautifulsoup4 requests django-treebeard webencodings urllib3 chardet idna certifi
Cleaning up...
After trying to start wagtail I have this final error message:
Traceback (most recent call last):
File "/home/ubuntu/workspace/env/bin/wagtail", line 7, in <module>
from wagtail.bin.wagtail import main
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/wagtail/bin/wagtail.py", line 10, in <module>
from django.core.management import ManagementUtility
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 11, in <module>
from django.conf import settings
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/conf/__init__.py", line 18, in <module>
from django.utils.functional import LazyObject, empty
File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/utils/functional.py", line 12
return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs})
This final error is the one I have not been able to solve. I opened the file functional.py and reviewed the contents and it looks correct to me. Any ideas on how to fix the error or what the root cause could be?
You are running Python 3.4, which is not supported by the current version of Django (2.1). You should either upgrade to Python 3.5 or above, or downgrade Django to 2.0.x by running pip install "Django>=2.0,<2.1".

FosUserBundle + Symfony 3.4

Since 7 days I tried to repair HwiOauthFukingBundle with facebook + FosUserOtherFukingBundle + Symfony 3.4.
And now, I have this incomprehensible errors in prod but not in dev.
[2018-03-17 14:45:27] php.WARNING: Warning:
require(/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php):
failed to open stream: No such file or directory
{"exception":"[object] (ErrorException(code: 0): Warning:
require(/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php):
failed to open stream: No such file or directory at
/var/www/vhosts/domaine.fr/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:223)"}
[]
And this one
[2018-03-17 14:45:27] request.CRITICAL: Uncaught PHP Exception
Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error:
require(): Failed opening required
'/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php'
(include_path='.:/opt/plesk/php/7.1/share/pear')" at
/var/www/vhosts/domaine.fr/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
line 223 {"exception":"[object]
(Symfony\Component\Debug\Exception\FatalErrorException(code: 0):
Compile Error: require(): Failed opening required
'/var/www/vhosts/domaine.fr/var/cache/prod/doctrine/orm/Proxies/__CG__ECUserBundleEntityImage.php'
(include_path='.:/opt/plesk/php/7.1/share/pear') at
/var/www/vhosts/domaine.fr/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:223)"}
[]
What's going on ?
I have clean the cache folder etc. but this error seems to be falling from the sky... this is a nightmare...

Exception in android build. Build error in codenameone

Hello I have tried to build an application and send it to an android build but am getting an build error.
This is a small snippet of exception in error log that I got when I put the build onto the server.
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : java.lang.RuntimeException: Exception parsing classes
Unknown source file : at com.android.dx.command.dexer.Main.processClass(Main.java:752)
Unknown source file : at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
Unknown source file : at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
Unknown source file : at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
Unknown source file : at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
Unknown source file : at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
Unknown source file : at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
Unknown source file : at com.android.dx.command.dexer.Main.processOne(Main.java:672)
Unknown source file : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
Unknown source file : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
Unknown source file : at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file : at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file : at com.android.dx.command.Main.main(Main.java:106)
Unknown source file : Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
Unknown source file : at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
Unknown source file : at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
Unknown source file : at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
Unknown source file : at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
Unknown source file : at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
Unknown source file : at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
Unknown source file : at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
Unknown source file : at com.android.dx.command.dexer.Main.processClass(Main.java:749)
Unknown source file : ... 12 more
Unknown source file : 1 error; aborting
:preDexDebug FAILED
:preDexDebug (Thread[Daemon worker,5,main]) completed. Took 56.932 secs.
Starting process 'command '/usr/java/jdk1.7.0_67/bin/java''. Working directory: /tmp/build2186746778357232766xxx/Starter Command: /usr/java/jdk1.7.0_67/bin/java -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /home/ec2-user/android-sdk/build-tools/23.0.1/lib/dx.jar com.android.dx.command.Main --dex --verbose --force-jumbo --num-threads=4 --output /tmp/build2186746778357232766xxx/Starter/build/intermediates/pre-dexed/debug/classes-050c44252ac48b6fb75508d313fd95ce08e1abcc.jar /tmp/build2186746778357232766xxx/Starter/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/8.3.0/jars/classes.jar
FAILURE: Build failed with an exception.
Please find the attached error log
This was due to us changing the behavior of Google Play Services. We are looking to redeploy the change with a slightly more conservative approach so we would still need the error log to confirm exactly what went wrong.
same happen for me
Log
com.codename1.social.GoogleImpl.init();
^
symbol: class GoogleImpl
location: package com.codename1.social
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:compileReleaseJavaWithJavac FAILED
:compileReleaseJavaWithJavac (Thread[Daemon worker,5,main]) completed. Took 21.094 secs.

CakePHP install on local pc (xampp) incorrect paths

I have script built with an old version of CakePHP.The script works just fine on live servers but when i tried to install it on my pc (with XAMPP installed) igot problems...I have this error:
Warning: include(cake\bootstrap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\hack\index.php on line 76
Warning: include(): Failed opening 'cake\bootstrap.php' for inclusion (include_path='\C:\xampp\htdocs\hack\cakecore;\C:\xampp\htdocs\hack\cakeapp\;.;C:\xampp\php\PEAR') in C:\xampp\htdocs\hack\index.php on line 76
Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your \cake core directory and your \vendors root directory. in C:\xampp\htdocs\hack\index.php on line 77
I'm pretty sure that this error is triggered by incorrect paths in index.php file,because if i made wrong path in index on the live website got exactly the same erorr.The problem is that i have no idea how to fix that paths.
My site files are located in: C:\xampp\htdocs\mysite
So here is how i made the paths on index.php file:
/**
* The full path to the directory which holds "app", WITHOUT a trailing DS.
*
*/
if (!defined('ROOT')) {
define('ROOT', DS.'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite');
}
/**
* The actual directory name for the "app".
*
*/
if (!defined('APP_DIR')) {
define('APP_DIR', 'cakeapp');
}
/**
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', DS.'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite'.DS.'cakecore');
}
Can you tell me what I missing?I have spent 2 days on this and can't find a solution.
You're defining CAKE_CORE_INCLUDE_PATH as DS.'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite'.DS.'cakecore' which in windows will translate to a wrong path of \C:\xampp\htdocs\mysite\cakecore. Notice it starts with \ when it should be C:\....
So make it 'C:'.DS.'xampp'.DS.'htdocs'.DS.'mysite'.DS.'cakecore' or 'C:\xampp\htdocs\mysite\cakecore' as there isn't any advantagle in using DS if you place C: in the path, it will work only in windows after all.

Resources