I try to config a program use xhprof.
When I use php-cli mode or php's built in webServer, the callgraph generate image works well.
But When I use nginx+php-fpm, the dot exec at xhprof_generate_image_by_dot blocks forever.
Then I install the pear Image_Graphviz.Write a simple case like this:
require_once 'Image/GraphViz.php';
$img = new Image_GraphViz();
$img->addNode(
'Node1',
array(
'URL' => 'http://link1',
'label' => 'This is a label',
'shape' => 'box'
)
);
$img->image('png');
php's built in webServer can generate png files ok,but php-fpm block at dot exec forever.
So, can anybody help me? What's wrong with this? Here is some relevant machine information:
The OS: OSX
The graphviz version:2.34.0
The App: nginx1.2.8+php-fpm+php5.4.21+xhprof(the latest version from github)
After reboot my machine.Everything turn to right.
Mystery.
Related
Hello Im working with Image Intervention. Project working very well from local server.
My remote server Digitalocean droplet and Lamp Ubuntu 14.04 installed. Im sure all necessary modules installed and active.
GD Version => 2.1.1-dev
imagick module version => 3.1.2
PHP Version 5.5.9-1ubuntu4.21
Image::make('uploads/products/'.$filename)->fit(440, 585)->insert('uploads/watermark.png','center',0,0)->save('uploads/products/'.$filename, 100);
if ->insert function bypass my codes working on droplet. but when add to ->insert to code throwing error message.
Laravel 5.2 throw this error message: Command (insert) is not available for driver (Gd) Im trying all of my mind. how to fix this problem. I lost a one day :(
setlocale(LC_ALL, 'en_GB.UTF-8');
$file = $request->file('file');
list($filename, $extension) = explode(".", $file->getClientOriginalName());
$filename = strtolower(str_slug(uniqid().'-'.$filename).'.'.$extension);
$fileSave = $file->move('uploads/post',$filename);
Image::make('uploads/post/'.$filename)->fit(440, 585)->insert('uploads/watermark.png','center',0,0)->save('uploads/post/'.$filename, 60);
setlocale(LC_ALL, 'tr_TR.UTF-8');
I solved my problem.
I before using Turkish locale settings on server. When I set to Turkish locale settings on any Ubuntu version. All small "i" characters changing big "İ" characters. you know right classnames on Laravel Framework. Every class names starting big characters. We dont need "İ" character working with developing codes.
This problem stole 3 days from my life. I am 12 times rebuilding to server. Im happy now !
After searching around, I found this aws_account_utils which does exactly what I hope to achieve - programmatically create aws account.
Unfortunately as a total ruby noob, I have no idea how to start using it even after reading the README.md.
I suspect I'd need the following steps:
Create create-account.rb
Use the util in the code
Run ruby create-account.rb
How should the content of create-account.rb be like?
Please show me a template.
With that I should be able to start experimenting and hacking.
Any other steps I should do?
Thanks in advance.
Plan below is rough and must be supplemented.
Create Gemfile file. This file is needed to specify project dependencies (libraries)
Put this line into Gemfile
gem 'aws_account_utils'
Run bundle install in your console / terminal
Create create-account.rb file with next code
require 'aws_account_utils'
aws_utils = AwsAccountUtils::AwsAccountUtils.new()
details = { 'fullName' => 'Herman Munster',
'company' => 'The Munsters',
'addressLine1' => '1313 Mockingbird Lane',
'city' => 'Mockingbird Heights',
'state' => 'CA',
'postalCode' => '92000',
'phoneNumber' => '(800) 555-1212',
'guess' => 'Test Account' }
resp = aws_utils.create_account(account_name: 'My Test Account 01',
account_email: 'adfefef#gmail.com',
account_password: 'foobar1212121',
account_details: details)
This code uses aws_account_utils library. Documentation you can find here.
After steps above you can run ruby create-account.rb.
Symptom...
docpad run results in the usual messages but it never gets past:
Currently on writeFiles at 45/45 100% =================================================
Environment -
osx 10.8.3
node v0.10.0
npm i.2.14
docpad 6.34.2
ImageMagick v6.8.5-3, which has been confirmed working from the command line
Steps to reproduce...
Install kitchensink skeleton (or the jade and adapt the coffeekup code in example)
Install docpad-plugin-associatedfiles
and docpad-plugin-thumbnails
Create an associate-files directory in Files and drop in another directory called 'gallery' with some .jpg's with no spaces in the filenames
Create a new page called gallery.html.coffee and cut and paste the coffeeKup example from thumbnails' read me file :) - see below.. [I've also tried simplifying it down to the bare functionality to show the thumbnails, by cutting out the checks on file-types and the links to the original sized images.]
docpad run and watch whilst it doesn't finish...
Observations -
If you remove the reference to getThumbnails and just list the associated files it all works peachy.
Filenames for the thumbnails that would be generated show up in the generated HTML file - but the thumbnails do not show up in the out directory (or anywhere else as far as I could find)
So questions...
am I missing the startlingly obvious? (here's hoping)
how do I inspect docpad.log?
I read the instructions for debugging, but so far I've not made sense of them enough to step into any code - sorry - I'm a real novice.
Thanks for any input,
The page looks like this:
---
layout: default
title: Gallery
---
image_exts = ['jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG']
images = #getDocument().getAssociatedFiles().findAll({extension: $in: image_exts}).toJSON()
for image in images
a href: image.url, -> img src: #getThumbnail(image.url, w: 100, h: 100), alt: image.name
I had the same problem, and I used the command:
$ docpad --debug 7 run
If you get the error "spawn ENOENT", you must install graphicsmagick, because the gm library needs some configuration if you use imagemagick.
You can try this command:
npm install --save docpad-plugin-thumbnails
I was facing the similar issue and it worked for me.. hope this helps!
Did you configure the plugin to use imageMagick in your docpad.coffee?
plugins:
thumbnails:
imageMagick: true
I'm having a problem getting the HTMLPurifier bundle to work. I installed is as so:
php artisan bundle:install Sanitizer
then I edited application/bundles.php
'sanitize' => array('auto' => true),
when I use it:
$clean_output = Sanitize::purify($bad_input);
I get an Unhandled Exception: Class 'Sanitize' not found
I also noticed that when I try: php artisan bundle:upgrade Sanitize,
I get an error saying bundle not installed.
What am I missing?
Any help greatly appreciated.
This bundle has been setup very badly, especially with the different namings and casings. Generally a bundle uses a standard name across the board. What's happening here is that when you install the bundle it's actually installing it to bundles/laravel-htmlpurifier. What you've defined in your bundles.php file is expecting it to be installed at bundles/sanitize.
You have two options.
Option 1
Rename the laravel-htmlpurifier directory to sanitize.
Option 2
Set the location key in the bundles.php file.
'sanitize' => array('auto' => true, 'location' => 'laravel-htmlpurifier')
This should also resolve the upgrading problems you were having. You shouldn't really have to do this as it's normally the responsibility of the bundle author to ensure everything is named correctly and consistently.
I'm using the following to upload an image from post data. it works on my server using php version: 5.2.16
When I try running the exact same script on my local server using MAMp and PHP Version 5.2.17
the file is not created.
if (isset($HTTP_RAW_POST_DATA))
{
// Get the data
$imageData=$HTTP_RAW_POST_DATA;
// Remove the headers (data:,) part.
// A real application should use them according to needs such as to check image type
$filteredData=substr($imageData, strpos($imageData, ",")+1);
// Need to decode before saving since the data we received is already base64 encoded
$unencodedData=base64_decode($filteredData);
echo "unencodedData: ".$unencodedData;
$key = microtime();
$key = md5($key);
// Save file.
$fp = fopen( '../../../uploadedImages/original/' . $key . '.jpg', 'wb' );
fwrite( $fp, $unencodedData);
fclose( $fp );
}
it looks like the post data does exist if I look at it in firebug. Any ideas why this isn't working in mamp?
Some things to try:
Check to make sure you are getting the raw data when the script is running on MAMP
Check the permissions of the directory it is trying to write to and make sure you have write access to it and apache has write access to it.
I had issues running some php modules on MAMP so I switched to using versions I installed using MacPorts. It gave me more control of extra extension I wanted to install and I got the latest versions of apache, php, and the php extensions.