I have copied a new installation of CakePHP 3 to a webhotel. On my local installation it runs without problems and shows the standard startup page, but on the webhotel I get a blank page.
If I place a test.php in /webroot it displays without errors.
If I in webroot/index.php include an
echo 'Show this line'
just before the line with
require dirname(DIR) . '/config/bootstrap.php';
it is displayed.
If I move the echo line below the require line it will not display.
So the error must be with require line.
Based on what I have found with Google I have included the following at the top in the webroot/index.php file:
ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
This gives me the following error when I display the page:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /.../config/bootstrap.php on line 106
Line 106 in config/bootstrap.php looks like this:
(new ConsoleErrorHandler(Configure::read('Error')))->register();
As I wrote at the start if I run the same setup locally I don't get the error, so my guess is that I am missing a php-extension or something else on the webhotel.
As an endnote I can run CakePHP 2 without problems on the webhotel.
It looks like your webhotel is running PHP < 5.4. CakePHP 3 requires at least PHP 5.4.16 to run correctly.
You can check the following link for a list of hosts that support PHP >= 5.4
http://phpversions.info/
Thank you. I missed that. Based on your comment I checked and the webhotel uses the following in the .htaccess:
AddType application/x-httpd-php56 php
and I had replaced the .htaccess on the webhotel with the .htaccess that came with CakePHP3.
Related
Hi I've been facing an issue on my website avcpetstore.com
-theme used in this is (Porto ecommerce theme)
I've tried the following steps already.
disabling all plugins (doesn't workout)
disabling current theme and activation other 2 themes (doesn't workout)
Php memory limit increased already- permalinks setup multiple times (did't workout)
all other things in terms of debug did't workout.console showing
Browser's console showing this error
Unable to fix malformed JSON
checkout.min.js?ver=7.0.0:1 ---------- Unable to fix malformed JSON
Probably in your checkout page file while copy-paste code you miss clicked and remover or added symbol like '<' so you should review code from end to start looking for unintended content. Also you could try disabling (commenting) all the hooks to that file one by one, maybe there is mistake in them.
Also you can try using the default woocommerce template file to see if it start working again and trying adding your custom code on top of your fresh default file.
I have uploaded my cakephp 3 app to production, I can login, but then getting the following error:
Element file "Element/sidebar/left_menu.ctp" is missing.
The weird part is, that on my local dev, it works.
The file is there.
Is there anything I am missing?
Cheers,
I am currently running Ubuntu 14.o4, and installed HTML Tidy on my computer. I am trying to use it within Bluefish (bluefish 2.2.9-0trusty1) but any time I run the filter, it gives me this error:
The command tidy -utf8 exited with error code 512.
The current external filter command for Tidy is: |tidy -utf8|
There's a conversation about this here: http://narkive.com/4QvPqDp2.2
Olivier Sessink, writing in 2012:
Post by Martin crysman ZahradnÃk
Hello, I am just wondering why I cannot use tidy directly from BF... If I try
The command tidy -qe '%i' exited with error code 512.
fixed in svn, commands with %i and %o work
again.
but the exit status message is still there, which is useless for
commands like tidy that generate an exit code for faulty html when
everything is working as expected.
I'm a bit in doubt how to handle this for 2.2.4:
1) remove the dialog - that means that bluefish will also not give an
error message if tidy is for example not installed at all
2) keep the dialog - and bluefish will always show this error message if the html is not perfect
Is there by any chance some errors in your HTML? Do you get the error with a syntacticly perfect "Hello, World" HTML sample?
As a work-around to HTML tidy reporting this error message, try the alternative menu option to invoke "Tidy HTML (perltidy)", which seems more resilient to errors in the HTML. The default options are not particularly good imho, so you may have to change those (either by editing the options in the external tools configuration dialog, or the rc file directory: ~/.bluefish/rcfile-2.0); e.g., -fws to freeze whitespace and -fnl to keep newlines the same gives you simple auto-indentation without completely reformatting the whole file.
I am using Timthumb to reisze pictures in my wordpress blog.
It's woirking fine on my local machine but when upload it on remote server Timthumb return me the following error:
Could not find the internal image you specified.
And a 400 Bad request in browser console.
How to fix this? i've been told that it might depend from server path configuration.
Timthumb version i am using is: 2.8.10
I just had that error and it was because it was looking for the file in the wrong place in the filesystem. Enable debugging and set it to level 3. Open the page where it says this error. Download the error log (same directory as the script). You'll see all the paths it tries. Output dirname(__FILE__) from just about anywhere. You'll see the real path it needs. Add it to the timthumb-config.php as
$_SERVER['DOCUMENT_ROOT'] = '/home/username/public_html';
Just as an example I had to do this (wrap in php tag). Previously it was using something with /bin/usr/htdocs in it, and that's too much detail!
Around line 850 in the getLocalImagePath funcion, add this:
$src = str_replace ( "~username/" , "" , $src );
This is optional, replace username with something else.
Another case where you are using some htaccess magic so the images are accessed like /files/2012/02 rather than /wp-content/uploads/2012/02 TimThumb would work well if it'd treat this as an external URL... But it treats it as internal and it won't find the images so set a docroot accordingly and you might need to use the replace hack mentioned previously.
I have some tweaks on .htaccess to hide the fact that I'm using Wordpress.
On timthumb 2.8.11.
After
$this->localImage = $this->getLocalImagePath($this->src);
i'v hadded this line of code
$this->src = str_replace('/file/', '/wp-content/uploads/', $this->src);
The /file/ in the normal WPway should be /wp-content/uploads/.
I am following step by step this tutorial http://code.google.com/apis/maps/articles/phpsqlajax.html . I have tried all the 3 ways to output data to an xml file . But i get error "error on line 9 at column 1: internal error" which is the line that php script begins. Connection to database is ok. tables and fields are ok. I tried and copy pasted the exact code from google's tutorial (same values everywhere) to check if there was a problem with my database engine or something and I got an error again this time error on line 10 at column 8: Extra content at the end of the document that is $xmlStr=str_replace('"','"',$xmlStr);
I am running XAMPP 1.7.4 [PHP: 5.3.5]
Did you forget this line?
header("Content-type: text/xml");
How do you call your file? From an url?
Thank you