So I am following this and I'm trying to run his first php example. I get the following error:
PHP Warning: require_once(Zend/Http/Header/HeaderValue.php): failed to open stream: No such file or directory in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Http/Client.php on line 45
I checked and the file is in fact not there. So I added it from the minimial 1.12 download. It then says Zend/Xml/Security.php doesn't exist so i add it.
Now I am getting the following error:
PHP Notice: Undefined offset: 1 in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/ClientLogin.php on line 150
PHP Stack trace:
PHP 1. {main}() /opt2/sites/gdataApi/test.php:0
PHP 2. Google_Spreadsheet->__construct() /opt2/sites/gdataApi/test.php:11
PHP 3. Google_Spreadsheet->login()/opt2/sites/gdataApi/Google_Spreadsheet.php:40
PHP 4. Zend_Gdata_ClientLogin::getHttpClient() /opt2/sites/gdataApi/Google_Spreadsheet.php:223
PHP Notice: Undefined variable: php_errormsg in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php on line 834
PHP Stack trace:
PHP 1. {main}() /opt2/sites/gdataApi/test.php:0
PHP 2. Google_Spreadsheet->addRow() /opt2/sites/gdataApi/test.php:24
PHP 3. Google_Spreadsheet->getSpreadsheetId() /opt2/sites/gdataApi/Google_Spreadsheet.php:62
PHP 4. Zend_Gdata_Spreadsheets->getSpreadsheetFeed() /opt2/sites/gdataApi/Google_Spreadsheet.php:252
PHP 5. Zend_Gdata->getFeed() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/Spreadsheets.php:150
PHP 6. Zend_Gdata_App->getFeed() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata.php:162
PHP 7. Zend_Gdata_App->importUrl() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php:213
PHP 8. Zend_Gdata_App::importString() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php:792
PHP Fatal error: Uncaught exception 'Zend_Gdata_App_Exception' with message 'DOMDocument cannot parse XML: ' in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php:833
Stack trace:
#0 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php(792): Zend_Gdata_App::importString('', 'Zend_Gdata_Spre...', NULL, NULL)
#1 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php(213): Zend_Gdata_App->importUrl('https://spreads...', 'Zend_Gdata_Spre...', NULL)
#2 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata.php(162): Zend_Gdata_App->getFeed('https://spreads...', 'Zend_Gdata_Spre...')
#3 /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/Spreadsheets.php(150): Zend_Gdata->getFeed('https://spreads...', 'Zend_Gdata_Spre...')
#4 /opt2/sites/gdataApi/Google_Spreadsheet.php(252): Zend_Gdata_Spreadsheets->getSpreadsheetFeed()
#5 /opt2/sites/gdataApi/Google_Spreadsheet.php(62): Google_Spreadsheet->getSpreadsheetId('test spreadshee...')
#6 /opt2/sites/gdataApi/test.php(24): Google_Spreadsheet in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php on line 833
I have a google spreadsheet that I would like to update programatically using php. Can you tell me whats going wrong with this script? Seems like this is an old article. Are there more recent articles I am missing?
Download Zend framework minimal version. Then extract archive and copy /library/Zend/Http/Header directory to your GData's /Zend/Http/ directory.
Related
The website randomly went down and I can't figure out how to correct the following error. I have tried toggling all plugins, the server was recently updated to PHP 7.4 from PHP 7.3 but no other website has had this issue.
My Setup:
PHP - PHP 7.4.11 (cli) (built: Oct 8 2020 17:32:43)
uname - Debian 4.19.146-1 (2020-09-17) x86_64 GNU/Linux
MySQL - mysql Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Error from the website:
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/functions.php(1717): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/load.php(664): is_blog_installed() #2
/WEBSITE_PATH/wp-settings.php(159): wp_not_installed() #3
/WEBSITE_PATH/wp-config.php(99): require_once('/home/swcsoldie...') #4
/WEBSITE_PATH/wp-load.php(37): require_once('/home/swcsoldie...') #5
/WEBSITE_PATH/wp-blog-header.php(13):
require_once('/home/swcsoldie...') #6 /WEBSITE_PATH/index.php(22):
require('/home/swcsoldie...') #7 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/option.php(116): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/l10n.php(69): get_option() #2
/WEBSITE_PATH/wp-includes/l10n.php(137): get_locale() #3
/WEBSITE_PATH/wp-includes/l10n.php(828): determine_locale() #4
/WEBSITE_PATH/wp-includes/class-wp-fatal-error-handler.php(46):
load_default_textdomain() #5 [internal function]:
WP_Fatal_Error_Handler->handle() #6 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Code from Line 258:
wp_cache_add( 'alloptions', $alloptions, 'options' );
An undefined function error in PHP is fatal error, and means you're calling a function that doesn't exist (at least, at the point and scope it's being called at). Most often, I'd wager 9/10 times, this happens while you're developing and you mistype a function name, str_repace instead of str_replace, for instance.
With all of that being said, wp_cache_add() is a WordPress Core function defined in /wp-includes/cache.php, and is being called by a core file: /wp-includes/option.php on line 258.
Since these core files, and core functions are triggering a fatal "undefined function" error, it means your WordPress installation is failing somewhere. It possibly got corrupted during an update of some kind - it's infrequent, but it does happen for any number of reasons.
To fix this: try reinstalling WordPress, as it is absolutely compatible with PHP 7.4.
I just added tinker to my Laravel project 5.4.
When I try to run:
php artisan tinker
I am getting following error:
PHP Warning: Uncaught ErrorException: require(/home/abdullah/php_apps/website): failed to open stream: Success in /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php:51
Stack trace:
#0 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php(51): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'require(/home/a...', '/home/abdullah/...', 51, Array)
#1 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php(51): require()
#2 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php(33): Laravel\Tinker\ClassAliasAutoloader->__construct(Object(Psy\Shell), '/home/abdullah/...')
#3 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/Console/TinkerCommand.php(59): Laravel\Tinker\ClassAliasAutoloader::register(Object(Psy\Shell), '/home/abdullah/...')
#4 [internal function]: Laravel\Tinker\Console\TinkerCommand->handle()
#5 /home/abdullah/php_apps/website/vendor/laravel/framework/src/Illuminate/Contai in /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php on line 51
PHP Fatal error: Laravel\Tinker\ClassAliasAutoloader::__construct(): Failed opening required '/home/abdullah/php_apps/website' (include_path='.:/home/abdullah/.phpbrew/php/php-7.0.1/lib/php') in /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php on line 51
[Symfony\Component\Debug\Exception\FatalErrorException]
Laravel\Tinker\ClassAliasAutoloader::__construct(): Failed opening required '/home/abdullah/php_apps/website' (include_path='.:/home/abdullah/.phpbrew/php/php-7.0.1/lib/php')
I have tried giving rights to various folders.
Also tried adding the Tinker class to console/kernel.php.
I fixed it finally by upgrading my version of laravel.
Laravel v5.4.0 to Laravel v5.4.33.
I am using the latest WAMPServer64 with PHP 5.5.12.
What I did: From a webserver (runs PHP 5.4.16) I have copied the modx folders to localhost, then I copied the entire database. I have also changed the database credentials accordingly via manager/includes/confic.inc.php.
When opening the manager login, I see the following:
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in \manager\includes\extenders\dbapi.mysql.class.inc.php on line 93
When I try to login, the manager does not show up and I get a bunch of errors, content of php_error.log:
PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in manager\includes\extenders\dbapi.mysql.class.inc.php on line 93
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP 2. DBAPI->escape() manager\processors\login.processor.php:51
PHP 3. DBAPI->connect() manager\includes\extenders\dbapi.mysql.class.inc.php:156
PHP 4. mysql_connect() manager\includes\extenders\dbapi.mysql.class.inc.php:93
PHP Notice: Undefined index: captcha_code in manager\processors\login.processor.php on line 53
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined index: rememberme in manager\processors\login.processor.php on line 54
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined variable: allowed_ip in manager\processors\login.processor.php on line 134
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined variable: allowed_days in manager\processors\login.processor.php on line 148
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined variable: newloginerror in manager\processors\login.processor.php on line 224
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Warning: Cannot modify header information - headers already sent by (output started at manager\processors\login.processor.php:54) in manager\processors\login.processor.php on line 298
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP 2. setcookie() manager\processors\login.processor.php:298
PHP Notice: Undefined variable: sql in manager\includes\extenders\dbapi.mysql.class.inc.php on line 276
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP 2. logHandler->initAndWriteLog() manager\processors\login.processor.php:302
PHP 3. logHandler->writeToLog() manager\includes\log.class.inc.php:42
PHP 4. DBAPI->insert() manager\includes\log.class.inc.php:76
I have searched for solutions on the net, some suggested to clear the cache, which is not directly possible since the manager interface does not load. I also tried to upgrade using the default install folder, same problem remains.
So if anyone has a clue how I can solve this without installing an old version of PHP, that would be great.
To get rid of the mysql deprecated warning you have to use Evo 1.0.15+ and you should change
$database_type = 'mysql';
to
$database_type = 'mysqli';
in config.inc.php
The 'only' thing that uses the old mysql_ functions is the installer then. The deprecated warnings are disabled in there for PHP 5.5.
MODx Evolution has a lot of old code in it. As you see by your warnings it is using deprecated mysql-functions. This is long known in the MODx Forums.
As for now you have two possible solutions:
Downgrade your local php version via WAMP to some (best, the same) PHP 5.4 version.
Change your PHP error-reporting level (inside the affected files or in your php.ini) to omit deprecated errors, as long as Evo has this issue.
Can check following solution
https://toster.ru/q/125593
really works !
:)
This is my Laravel error:
FatalErrorException in compiled.php line 6376:
Class 'Illuminate\Html\HtmlServiceProvider' not found
in compiled.php line 6376
at HandleExceptions->fatalExceptionFromError(array('type' => '1', 'message' => 'Class 'Illuminate\Html\HtmlServiceProvider' not found', 'file' => '/home/nl/Laravel/storage/framework/compiled.php', 'line' => '6376')) in compiled.php line 1721
at HandleExceptions->handleShutdown()
And my console error:
Generating autoload files
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home
/nl/Laravel/storage/framework/compiled.php on line 6376
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/artisan
:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel/vend
or/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Laravel/ven
dor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/nl
/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/
nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/stora
ge/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/nl/La
ravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/nl/Lar
avel/storage/framework/compiled.php:6362
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Th
e stream or file "/home/nl/Laravel/storage/logs/laravel-2015-04-20.log" could no
t be opened: failed to open stream: Permission denied' in /home/nl/Laravel/stora
ge/framework/compiled.php:12372
Stack trace:
#0 /home/nl/Laravel/storage/framework/compiled.php(12431): Monolog\Handler\Strea
mHandler->write(Array)
#1 /home/nl/Laravel/storage/framework/compiled.php(12313): Monolog\Handler\Rotat
ingFileHandler->write(Array)
#2 /home/nl/Laravel/storage/framework/compiled.php(12081): Monolog\Handler\Abstr
actProcessingHandler->handle(Array)
#3 /home/nl/Laravel/storage/framework/compiled.php(12179): Monolog\Logger->addRe
cord(400, 'exception 'Symf...', Array)
#4 /home/nl/Laravel/vendor/laravel/framework/src/Illuminate/Foundation/Exception
s/Handler.php(47): Monolog\Logger->error('exception 'Symf...')
#5 /home/nl/Laravel/app/Exceptions/Handler.php(27): Illuminate\Foundation\Except
ions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErrorExceptio
n))
#6 in /home/nl/Laravel/storage/framework/compiled.php on line 12372
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/artisan
:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel/vend
or/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Laravel/ven
dor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/nl
/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/
nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/stora
ge/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/nl/La
ravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/nl/Lar
avel/storage/framework/compiled.php:6362
Script php artisan clear-compiled handling the post-update-cmd event returned wi
th an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider'
not found in /home/nl/Laravel/storage/framework/compiled.php on line 6376
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/ar
tisan:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel
/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Larave
l/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /ho
me/nl/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /
home/nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/
storage/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/
nl/Laravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/n
l/Laravel/storage/framework/compiled.php:6362
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with messag
e 'The stream or file "/home/nl/Laravel/storage/logs/laravel-2015-04-20.log
" could not be opened: failed to open stream: Permission denied' in /home/n
l/Laravel/storage/framework/compiled.php:12372
Stack trace:
#0 /home/nl/Laravel/storage/framework/compiled.php(12431): Monolog\Handler\
StreamHandler->write(Array)
#1 /home/nl/Laravel/storage/framework/compiled.php(12313): Monolog\Handler\
RotatingFileHandler->write(Array)
#2 /home/nl/Laravel/storage/framework/compiled.php(12081): Monolog\Handler\
AbstractProcessingHandler->handle(Array)
#3 /home/nl/Laravel/storage/framework/compiled.php(12179): Monolog\Logger->
addRecord(400, 'exception 'Symf...', Array)
#4 /home/nl/Laravel/vendor/laravel/framework/src/Illuminate/Foundation/Exce
ptions/Handler.php(47): Monolog\Logger->error('exception 'Symf...')
#5 /home/nl/Laravel/app/Exceptions/Handler.php(27): Illuminate\Foundation\E
xceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErr
orException))
#6 in /home/nl/Laravel/storage/framework/compiled.php on line 12372
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/ar
tisan:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel
/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Larave
l/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /ho
me/nl/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /
home/nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/
storage/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/
nl/Laravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/n
l/Laravel/storage/framework/compiled.php:6362
I refer to this tutorial, and am following these steps:
1."illuminate/html": "5.*"
2.Run: composer update
3.Add to the app.php providers array:
'Illuminate\Html\HtmlServiceProvider',
4.Add to the app.php aliases array:
'Html' => 'Illuminate\Html\HtmlFacade',
'Form' => 'Illuminate\Html\FormFacade',
but still not work, someone could give some advice?
I've found there is a bit of an issue with that library that composer requires - try changing:
"illuminate/Html" : "5.0.*"
To..
"Illuminate/Html": "5.0.*#dev"
in the composer.json in the root of your laravel project.
I fall this problem,solve this and wrote a blog about it.For use laravel html helper you need to require this dependency in your composesr.josn file and need to require those file.For full process follow this url http://www.kingpabel.com/laravel-html-helper/
I'm trying to learn Symfony but so far just keep getting hung up on installation and things other than the actual development of my app.
I try to create a new Symfony project on my Windows machine using the installer. I'm following the instructions exactly as it says in the book. I can successfully download the symfony.phar but when I run:
php symfony.phar
I get the following error:
PHP Warning: Phar::mapPhar(symfony.phar): failed to open stream: No such file or directory in symfony.phar on line 9
PHP Stack trace:
PHP 1. {main}() symfony.phar:0
PHP 2. Phar::mapPhar() symfony.phar:9
Warning: Phar::mapPhar(symfony.phar): failed to open stream: No such file or directory in symfony.phar on line 9
Call Stack:
0.0017 227224 1. {main}() symfony.phar:0
0.0017 227920 2. Phar::mapPhar() symfony.phar:9
PHP Fatal error: Uncaught exception 'PharException' with message 'unable to open phar for reading "symfony.phar"' in symfony.phar:9
Stack trace:
#0 symfony.phar(9): Phar::mapPhar('default.phar')
#1 {main}
thrown in symfony.phar on line 9
Fatal error: Uncaught exception 'PharException' with message 'unable to open phar for reading "symfony.phar"' in symfony.phar on line 9
PharException: unable to open phar for reading "symfony.phar" in symfony.phar on line 9
Call Stack:
0.0017 227224 1. {main}() symfony.phar:0
0.0017 227920 2. Phar::mapPhar() symfony.phar:9
I can't find anything that helps with this.
The reason appears to be that in my Windows command prompt I was in a sub directory of C:\Users\Me\My Documents. Neither the symfony.phar, nor Composer will work from this directory. It has to be from C:\Users\Me\Documents which is the actual phsyical location, as opposed to My Documents which is just a virtual directory.
I don't know the technicalities of exactly why it doesn't work though.