The main reason for not loading a config file in the server which worked well in localhost:
Code Snippet from public_html/admin.php
$yii = dirname(__FILE__) . '../framework/yii.php';
$config = dirname(__FILE__) . '/admin/config/main.php';
print_r($config);
Result in localhost:
C:\xampp\htdocs\*****/admin/config/main.php
Result in sever:
/home/folder_name/domains/*****/public_html/admin/config/main.php
Sever Result from public_html/index.php:
/home/folder_name/domains/******/public_html/protected/config/main.php
I am writing this because I had spent hours to trace the point.Its working in FrontEnd but not working in BackEnd. What was the main reason?
Finally, I got the answer:
$yii = dirname(__FILE__) . '../framework/yii.php';
This code is used during multiple domain on single hosting. But the code needs correction:
$yii = dirname(__FILE__) . '/framework/yii.php';
I have uploaded framework folder within public_html.
Related
I am trying to install a Laravel application in Shared Hosting following this tutorial where my server's PHP version is 7.1.17 and my Laravel version is 5.6.15.
When I am trying to browse my application using Chrome I can see only a White page, even no error is there.
I tried to debug the application and found that below code of index.php is not working.
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
What is the solution of this issue?
If there is no error_log or your error log are empty
Check if it's a php version is a latest 7.1 or higher
Make sure YOUR_PATH_DIR are correct
$app = require_once DIR.'/YOUR_PATH_DIR/bootstrap/app.php';
require DIR.'/YOUR_PATH_DIR/vendor/autoload.php';
We face the "net::ERR_INCOMPLETE_CHUNKED_ENCODING" errors on our production site and cant find any working solution. StackOverflow is full of questions on this subject and we tried this and that but no working solution found. Our system is based on Symfony2+PHP5.6+Apache 2.4.x running on CentOS7.
Symptoms are that app is working fine when server starts ... but after some time the browser reports "net::ERR_INCOMPLETE_CHUNKED_ENCODING" errors and doest show certain pages (because they are loaded incompletely). Restarting apache fixes this for some time but it appears again soon. StackOverflow contains a lot of different hints that doesnt help us to understand the source of the problem. Can anyone give us some REAL hint here?
After further investigation I found out that server sends incorrect content-lenght information to browser for some reasons and its the source of the error.
To adjust this I have enabled content gzipping by adding 'SetOutputFilter DEFLATE' to Apache config file see details here http://httpd.apache.org/docs/2.4/mod/mod_deflate.html . This simple setting caused 'ERR_INCOMPLETE_CHUNKED_ENCODING' error to disappear and apps are working correctly for now. Whats more by gzipping the content the bandwidth dropped significantly.
In the context of a Controller in Drupal 8 (works for Symfony Framework as well) this solution worked for me:
$response = new Response($form_markup, 200, array(
'Cache-Control' => 'no-cache',
));
$content = $response->getContent();
$contentLength = strlen($content);
$response->headers->set('Content-Length', $contentLength);
return $response;
Otherwise the response header 'Transfer-Encoding' got a value 'chunked'. This may be a problem for some browsers.
I'm trying to set Parsoid extension and Visual Editor on my wiki page. It is NOT on my localhost. Those who will use the Visual Editor must log in, but the content of the wiki can be read without logging in.
The address is http://contractor.bg/wikimedia/index.php?title=Main_Page
I downloaded the Parsoid extension (in the extension files there is no settings.js file, so I created it according to an example).
My settings are:
in the LocalSettings.php file:
require_once "$IP/extensions/VisualEditor/VisualEditor.php";
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
wfLoadExtension( 'Parsoid' );
$wgVisualEditorParsoidURL = 'http://contractor.bg:2083';
$wgVisualEditorParsoidPrefix = 'wikimedia';
//$wgSessionsInObjectCache = true;
//$wgVisualEditorParsoidForwardCookies = true;
//$wgVisualEditorParsoidTimeout = 120;
I tried with to uncomment the last lines, but it still does not work.
In the settings.js file:
parsoidConfig.setMwApi( 'wikimedia', { uri: 'http://contractor.bg/wikimedia/api.php' } ); // I also tried setting an interwiki value, I am not quite sure what is the difference)
parsoidConfig.serverPort = 2083;
parsoidConfig.serverInterface = 'contractor.bg';
parsoidConfig.strictSSL = false;
parsoidConfig.allowCORS = 'contractor.bg/wikimedia'; // I also tried only contractor.bg)
At the moment when I try to Edit a page with the Visual Editor, I receive an error:
Error loading data from server: 401: parsoidserver-http: HTTP 401. Would you like to retry?
Parsoid is not a MediaWiki extension (well, there was an extension with this name as a support mechanism for the actual Parsoid, but it was never standalone and is no longer required). It is an external service.
You need to actually start the Parsoid service by running node bin/server.js from the Parsoid directory. Ensure it is actually running on the port you specify in the VisualEditor config (2083) - it looks like you have something else there.
Steps I followed:
Downloaded the Sabredav zip file - unzipped it.
Downloaded apache webserver 2.2 and PHP 5.3
Then followed the instructions mentioned in the 'get Started' section on Sabredav website.
Created 'data and public' fiels (located them in /sabredav/vendor/)
Created the server.php file (located it in /sabredav/vendor/)
Now tried to open the server.php file in browser -
Here it opens using the file protocol..
Fails to open in expected - 'http ://mydomain/sabredav/server.php
Can anybody please help me on this ?
Thanks
In server.php, use the browser plugin tu see files in Public folder.
Your server must be like this:
include 'SabreDAV/vendor/autoload.php';
use
Sabre\DAV;
$rootDirectory = new DAV\FS\Directory('public');
// The server object is responsible for making sense out of the WebDAV protocol
$server = new DAV\Server($rootDirectory);
// If your server is not on your webroot, make sure the following line has the correct information
$server->setBaseUri('/server.php'); // if its in some kind of home directory
// The lock manager is reponsible for making sure users don't overwrite each others changes. Change 'data' to a different
// directory, if you're storing your data somewhere else.
$lockBackend = new DAV\Locks\Backend\File('data/locks');
$lockPlugin = new DAV\Locks\Plugin($lockBackend);
$server->addPlugin($lockPlugin);
$server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
$plugin = new \Sabre\DAV\Browser\Plugin();
$server->addPlugin($plugin);
// All we need to do now, is to fire up the server
$server->exec();
I am running a magento 1.7.0.2 instance with WAMP 2.1 on Windows 7. My goal is to set up one magento store, and one
I followed the tutorial described here and I setup website profi on a subdirectory, but when I accessed the frontend on http://localhost/profi/ the first thing I noticed that the images paths were broken.
Broken: http://localhost/bms/profi/skin/frontend/default/default/images/logo.gif
Correct:
http://localhost/bms/skin/frontend/default/default/images/logo.gif
This is the same for the JS & CSS files. I've made the following modifications to the index.php file in the profi folder:
$mageFilename = MAGENTO_ROOT . '../../app/Mage.php';
/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'profi';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website';
It was a matter of configuring the second website's URLs.
I went to System > Configuration > General > Web > Unsecure. The Base URL was http://localhost/profi/ and I added ../ to the following the following:
Base Skin URL: {{unsecure_base_url}}../skin/
Base Media URL: {{unsecure_base_url}}../media/
Base JavaScript URL: {{unsecure_base_url}}../media/
That did the trick. I see on the frontend everything looks in order. Hope I won't run into anymore problems with this set-up.