Joss Posted December 16, 2016 Share Posted December 16, 2016 Hello chaps and chappesses. I have just cobbled together a new dev server (er ... that was hard) using Centos and Webmin. I have two installs of PW on it, both are working, except neither are uploading images to a standard image field. The problem seems to be that it all gets stuck with the uploading twirly thing going round and round and round and..... So, errors: Fatal error: Call to a member function getConfigData() on null in <b>/home/aworldcalleddirt/public_html/wire/core/Pageimage.php</b> on line 486 Error: Call to a member function getConfigData() on null (line 486 of ...../public_html/wire/core/Pageimage.php) In console on Chrome: Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at Function.parseJSON (JqueryCore.js?v=1481814737:2) at XMLHttpRequest.<anonymous> (InputfieldImage.js?v=119-1481814737:1403) This is the most recent dev version of PW and I am using php 5.6.* (something) Nothing helpful in apache logs. I have dug through various posts and am now dizzy Help.........! Link to comment Share on other sites More sharing options...
LostKobrakai Posted December 16, 2016 Share Posted December 16, 2016 The javascript error is most likely just caused by the php error, which does return html markup instead of the expected json content. So I'd rather expect that php does have some problems on the actual upload of the file / or moving it from the temp folder to it's final location. So I'd rather look into known issues on the php side, even though I cannot help you narrowing it down even more. 1 Link to comment Share on other sites More sharing options...
horst Posted December 16, 2016 Share Posted December 16, 2016 Hi Joss, what is the return value of that js json parse error? It will be a PHP error. You may have a look into the server reponse of that ajax upload request in the network tab. Link to comment Share on other sites More sharing options...
Joss Posted December 16, 2016 Author Share Posted December 16, 2016 34 minutes ago, horst said: Hi Joss, what is the return value of that js json parse error? It will be a PHP error. You may have a look into the server reponse of that ajax upload request in the network tab. Hi Horst How do I find the return value? In the network tab it is showing: Link to comment Share on other sites More sharing options...
LostKobrakai Posted December 16, 2016 Share Posted December 16, 2016 Click on the url part in the table. This will open the details view with a few new tabs to look at. Link to comment Share on other sites More sharing options...
Joss Posted December 16, 2016 Author Share Posted December 16, 2016 16 minutes ago, LostKobrakai said: Click on the url part in the table. This will open the details view with a few new tabs to look at. Do you mean the link on the left under "name"? If I do that, I end up with headers, preview, response and timing. Headers just gives files details Preview is the image, obviously Response says no response data available Timing says stalled. I am assuming there is something wrong with my php installation - or a module missing or something. This is where I am well and truly out of my depth! Joss Link to comment Share on other sites More sharing options...
horst Posted December 17, 2016 Share Posted December 17, 2016 yep the response tab should be the right if it says no response available, it is liyng to you, as it then cannot parse a json value. ?? Link to comment Share on other sites More sharing options...
Joss Posted December 17, 2016 Author Share Posted December 17, 2016 Ummm.... So, any suggestions? I am guessing this has something to do with the default php 5.6.25 configuration, but I have no idea what to look for. Link to comment Share on other sites More sharing options...
Joss Posted December 17, 2016 Author Share Posted December 17, 2016 Okay, it is definitely the php config. I just remembered that I also had 5.4.16 on the box, so I used that instead on a test site, and uploads seem to work. So, I wonder what is up with 5.6.25? Link to comment Share on other sites More sharing options...
gmclelland Posted December 17, 2016 Share Posted December 17, 2016 Can't talk much right now, but this might help Link to comment Share on other sites More sharing options...
Joss Posted December 17, 2016 Author Share Posted December 17, 2016 I saw that. And a few others. I have tried adding always_populate_raw_post_data = -1 to the ini file, but it didn't seem to achieve anything. Thought it might be the culprit, too, so that was a let down. Link to comment Share on other sites More sharing options...
evan Posted February 14, 2017 Share Posted February 14, 2017 Came across this issue today when trying to push a PW installation to an AWS server running PHP 5.6.29 on CentOS. File uploads weren't working with the same getConfigData() error, and front-end image sizing was delivering the same error. Turns out php-gd wasn't installed by default. Running sudo yum install php-56gd fixed it for me. 2 Link to comment Share on other sites More sharing options...
Jozsef Posted February 28, 2017 Share Posted February 28, 2017 Ok, here is a strange one running PW 3.0.33 on PHP 5.4.45 and have max image dimensions set up to resize images to 2000x2000 pixels on upload. Portrait mage upload results in a missing JSON response and the thumbnail just sitting there with 100% progress bar and the spinning wheel. I can upload landscape images but portrait ones trigger the error. I rotated a portrait image before upload and the same image was uploaded successfully then. I'm getting this error for portrait images in Chrome: Uncaught TypeError: Cannot read property 'length' of null at XMLHttpRequest.<anonymous> (InputfieldImage.min.js?v=119-1488236130:1) (anonymous) @ InputfieldImage.min.js?v=119-1488236130:1 in Safari: TypeError: null is not an object (evaluating 'aM.length') Any idea what's going on here? Thanks Link to comment Share on other sites More sharing options...
gmclelland Posted February 28, 2017 Share Posted February 28, 2017 Try installing the Tracy Debugger module http://modules.processwire.com/modules/tracy-debugger/ . I believe there is new feature in that module to handle ajax errors like this now, but may also require updating Processwire to a newer version as well. It might give you more insight into what is causing the error. 1 Link to comment Share on other sites More sharing options...
TLT Posted June 21, 2017 Share Posted June 21, 2017 FYI : I just encountered the very same problem and symptoms on a PW 3.0.61 install, on both a local ubuntu server (php 7.0) and distant dirty-test-shared-OVH server. Doesn't happen on every image, although I can't figure out what the rule is (doesn't seem size nor orientation-related). Fun-fact : images are indeed uploaded, and show up in the assets' folder, but will not be shown on page edit in admin. Using Imagemagick core module seems to be a valid workaround. details ? Same as first post : Error: Uncaught Error: Call to a member function getConfigData() on null in /wire/core/Pageimage.php:486 Stack trace: #0 /wire/core/Pageimage.php(346): ProcessWire\Pageimage->___size(260, 0, Array) #1 /wire/core/Pageimage.php(632): ProcessWire\Pageimage->size(260, 0, Array) #2 /wire/modules/Inputfield/InputfieldImage/InputfieldImage.module(495): ProcessWire\Pageimage->width(260, Array) #3 /wire/modules/Inputfield/InputfieldImage/InputfieldImage.module(558): ProcessWire\InputfieldImage->getAdminThumb(Object(ProcessWire\Pageimage), false) #4 /wire/core/Wire.php(389): ProcessWire\InputfieldImage->___renderItem(Object(ProcessWire\Pageimage), 'images_c46c5e26...', 2) #5 /wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___renderItem', Array) (line 486 of /wire/core/Pageimage.php) Link to comment Share on other sites More sharing options...
teppo Posted November 3, 2017 Share Posted November 3, 2017 On 14/02/2017 at 2:18 AM, evan said: Came across this issue today when trying to push a PW installation to an AWS server running PHP 5.6.29 on CentOS. File uploads weren't working with the same getConfigData() error, and front-end image sizing was delivering the same error. Turns out php-gd wasn't installed by default. Running sudo yum install php-56gd fixed it for me. Thanks for pointing me to the right direction Stumbled upon this issue after moving to a new version of PHP (5.6.x.) Working with Ubuntu here, so in my case the solution was "sudo apt-get install php5.6-gd" followed by "sudo apache2ctl restart" – and the issue is now gone. 1 Link to comment Share on other sites More sharing options...
horst Posted November 3, 2017 Share Posted November 3, 2017 With the diagnostics module(s) there is also one for (missing) server image feature detection. 4 Link to comment Share on other sites More sharing options...
teppo Posted November 3, 2017 Share Posted November 3, 2017 This may be a bit off-topic for this thread, but I was actually kind of surprised at how many features I had to manually install after updating PHP: php5.6-xml, php5.6-mbstring, php5.6-mysql, php5.6-curl, php5.6-mcrypt, and now php5.6-gd. All features that I would've expected to be there by default. I guess it's a good thing that there's not too much clutter by default and there are different use cases, but like I said, some of those caught me by surprise. (Note: I'm using ppa:ondrej/php, so the default Ubuntu package, for an example, might have a different set of features enabled by default.) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now