Two Errors whilst installing phpBB onto my forums - php

So auto installer was down on my web host provider and this was the first time trying to install a forums. I do not understand coding so when i cam across these errors i wasn't sure how to fix them.
Here are the screenshots:
I downloaded it straight from the phpBB website unedited.
Code:
{
$json_response = new \phpbb\json_response();
$json_response->send(array(
'success' => true,
));
}

Related

WooCommerce woocommerce_rest_authentication_error on WordPress localhost

I'm trying to get solution for this issue but can't find it out.
I'm developing a WordPress plugin using Woocommerce APIs, i.e trying to insert a product reading from external JSON source. So when I try to call
$woocommerce->get( 'products', $data );
I get a fatal error like that:
Fatal error: Uncaught Automattic\WooCommerce\HttpClient\HttpClientException: Error: Firma non valida - la firma fornita non corrisponde. [woocommerce_rest_authentication_error] in /Users/hal/Documents/www/wordpress/wp-content/plugins/.../vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php:324
(StackTrace not reported here, not useful to find other informations).
Error reported is 401, about this most weird thing is that the same code on localhost does not work, if I upload & try same code it on production VPS ... it works. Searched on many topics about this, no clear responses until now so sorry for duplicate, if is this the case.
$woocommerce was previously instanced as:
$woocommerce = new Client(
'http://localhost/wordpress',
'ck_...', // Your consumer key
'cs_...', // Your consumer secret
[
'wp_api' => true, // Enable the WP REST API integration
'version' => 'wc/v2' // WooCommerce WP REST API version
]
);
ck/cs pairs was just generated from wordpress, site url is obviously http://localhost/wordpress (and I tried without success i.e http://localhost/wordpress/, https://localhost/wordpress and so on)
If this could matter (...and I guess yes), I'm trying to debug this code on MAMP (apache on 80 port, mysql on 3306) running # localhost w/ basic installation, on MacOS Sierra 10.12.6.
Hope I was clear and anyone solved this problem, thanks in advance
If You are using http request then you have to user oauth for authorization for rest api

Mediawiki CSS not loading on hosted server (IIS)

I am trying to get mediawiki hosted via intranet on WindowsServer2012r2. I have installed mediawiki, php7, and mysql 5.x via Web platform installer. Once all were installed and setup I was able to connect both locally and via networked computers to mediawiki. I noticed however that the CSS for mediaWiki was not being executed. I have gone through the steps provided # Styles not displaying and Manual:Errors and symptoms but could not resolve the issue. The browser console shows the below issue.
Running load.php in the browser returns this error:
checkUrlExtension() ) { return; } // Respond to resource loading request. // foo()->bar() syntax is not supported in PHP4, and this file needs to *parse* in PHP4. $configFactory = ConfigFactory::getDefaultInstance(); $resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ), LoggerFactory::getInstance( 'resourceloader' ) ); $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest ) ); Profiler::instance()->setTemplated( true ); $mediawiki = new MediaWiki(); $mediawiki->doPostOutputShutdown( 'fast' );
Just to confirm: I updated the .htaccess file in the mywiki/img folder. Any help greatly appreciated.

Drupal Module installation error- File Transfer failed, reason: /mysite.com/sites/all/modules is outside of the /mysite.com

I have installed Drupal on Windows 2012 R2 (IIS 8.5) on my DEV and TEST servers. They are clean / out-of-the-box installations. My DEV environment is working fine, but I can’t install modules on my TEST environment. I’ve gone over the installations trying to figure out what is different, but I’ve been beating my head against the wall and they seem identical. Clearly they are not.
Problem
When installing a module, I get this error:
Installation failed! See the log below for more information.
module_filter
•Error installing / updating
•File Transfer failed, reason: /mysite.com/sites/all/modules is outside of the /mysite.com
(Note this is from the Authorize.php)
The permission on my public download folder seems fine – the module uploads and extracts just fine.
My public file system path is set to “sites/default/files” and my temporary directory is set to “sites/default/files/tmp”.
I can't figure out why it thinks the modules folder is outside of my root site!
I’m stumped. Any help would be appreciated!!!
Thanks
Tom Hundley
Solution
As it turns out, this is a bug in Drupal running on IIS. The checkPath method of filetransfer.inc. is case-sensitive, so depending on how you setup the site in IIS, it might work or it might not work! This explained why things work on my DEV environment but not TEST.
Edit the checkPath method in includes/filetransfer/filetransfer.inc and add this code:
$full_path = strtolower($full_path);
$full_jail = strtolower($full_jail);
just before the path comparison:
if ($full_jail !== $full_path) { ... }
FIXED!
References
A HUGE thanks goes out to "sevenares" for posting the solution to this problem here:
https://www.drupal.org/node/1071870#comment-8507091
I hope this helps someone.
Happy coding,
Tom Hundley

Drupal module Azure Blob broken images

I just started building a Drupal site with Azure. I installed the Azure Blob module and everything works correctly (local environment) including displaying and uploading images to the storage blob. However, after deploying the site and database to a staging server, all the images are broken. I made sure the images are present since I've uploaded them while working locally. I'm unable to locate what the actual issue is.
The module hasn't been updated for a while and I spent some time digging through the code for the module, but without avail. I was wondering if anyone has run into similar issues and could perhaps point me to the right direction. Thanks in advance.
I was finally able to figure it out what the problem is. I was unable to display or upload images when everything is deployed to the Azure, unsure of what the exact problem was I went through the process of trial and error by eliminating possible causes one by one. It all comes down to making a change in the module itself. In the file "azure_blob.streamwrappers.inc", go to the function createStorageClient. You need to specify a BlobEndpoint in the configuration.
if (!isset(self::$clients[$scheme])) {
// Obtain user configuration from database
$configuration = ctools_export_crud_load('azure_blob', $scheme);
if (isset($configuration)) {
// #todo Use shared access signature to specify a specific blob endpoint
$connection_string = 'DefaultEndpointsProtocol=https;AccountName=' .
$configuration->account . ';AccountKey=' . $configuration->primary_key . ';BlobEndpoint=http://[StorageName].blob.core.windows.net/';
self::$clients[$scheme] =
ServicesBuilder::getInstance()->createBlobService($connection_string);
// Store other configuration properties in client object
self::$clients[$scheme]->blob_container = $configuration->blob_container;
self::$clients[$scheme]->cache_control = $configuration->cache_control;
}
else {
throw new Exception(t('Invalid storage scheme "#stream"', array('#stream' => $scheme)));
}
}
return self::$clients[$scheme];
I hope this helps whomever that runs into the same issue in the future. I was literally pulling my hair out trying to find a solution for 2 days :)

Zend_OpenId_Consumer login function hangs - even in the sample code

I've been trying to get a simple OpenId log-in working using first php-openId (Jain) and then the ZendFramework, and in both cases I run up against a similar problem. I'm using the example Zend code from step 38.2.2 of http://framework.zend.com/manual/en/zend.openid.consumer.html.
I see the log-in page fine, but when I enter my openId, this code executes:
if (isset($_POST['openid_action']) &&
$_POST['openid_action'] == "login" &&
!empty($_POST['openid_identifier'])) {
echo "New consumer";
$consumer = new Zend_OpenId_Consumer();
echo "Gotim";
if (!$consumer->login($_POST['openid_identifier'])) {
$status = "OpenID login failed.";
echo "Failure";
}
echo "Continuing";
The code seemingly hangs on the function call to $consumer->login. I see the output from my first two echos, but I never see either Failure or Continuing (and without the echos I just get a 500 Server Internal Error when I try to log-in). If I enter an invalid openId then I get the correct "OpenID login failed." error message.
I apologize if I'm being a moron here. I'm a former programmer who got promoted to management, and I'm trying to get back into it - but I'm using a bunch of technologies that are new to me (PHP, OpenID, Zend Framework), and this just isn't making any sense right now.
Does anyone have any ideas where to look? I can't believe that the Framework itself is bugged (especially not when I had a similar problem with the Jain openId stuff also). I'm using fatcow.com for web hosting - not sure if that's relevant.
Your code seems to be failing when trying to make the external HTTP connection to the OpenID provider. This could be caused by a number of things, but here's a couple suggestions:
Perhaps you're behind a proxy?
If not that, maybe your current host does not allow contacting remote servers using sockets (the url_fopen ini directive). The default adapter for Zend_Http_Client is its socket adapter.
So, I would recommend trying is to pass a Zend_Http_Client instance using a different adapter to your Zend_OpenId_Consumer class using the setHttpClient method.
There are a couple different client adapters available:
Zend_Http_Client_Adapter_Socket (default)
Zend_Http_Client_Adapter_Proxy
Zend_Http_Client_Adapter_Test
Zend_Http_Client_Adapter_Curl
Try something like this:
$client = new Zend_Http_Client(null, array(
'adapter' => 'Zend_Http_Client_Adapter_Proxy',
'proxy_host' => 'example.com',
'proxy_port' => 8000,
'proxy_user' => 'user',
'proxy_pass' => 'pass'
));
$consumer = new Zend_OpenId_Consumer();
$consumer->setHttpClient($client);
Your ISP should have documentation about their proxy, if this is in fact the issue.
If proxying is not your problem, try the curl adapter and see if you have any more luck.
I still don't really understand what's wrong, but I tried running the same code on a different web host (x10hosting.com) and my sample code worked immediately. Therefore I have to conclude that this is some kind of limitation of the Fatcow webhosting service, which is rather a shame. I guess I'll be changing hosts.
If you are getting a 500 error, there is definitely a more detailed message in the web server logs. If your server is running apache, then it is most likely under /usr/local/apache/logs/error_log or /etc/httpd/logs/error_log or something similar. I am assuming you are on a shared hosting plan, so you won't have access to these. You should contact your webhosting company, as they will be able to look through the logs for you.

Categories