First upload test received these errors

Asked by Matthew Ritchie

Warning: file(/usr/share/fonts/default/TrueType/fonts.scale) [function.file]: failed to open stream: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 549

Warning: mkdir() [function.mkdir]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 350

Warning: fopen(./temp/defaultglassyd/readme.txt) [function.fopen]: failed to open stream: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 281

Warning: unlink(./temp/defaultglassy) [function.unlink]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 387

Warning: chmod() [function.chmod]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 420

Warning: chmod() [function.chmod]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 423

Warning: chmod() [function.chmod]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 427

Warning: chmod() [function.chmod]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 455

Warning: chmod() [function.chmod]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 458

Warning: chmod() [function.chmod]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 462

Warning: chmod() [function.chmod]: No such file or directory in /home/bluegree/public_html/buttons/buttonincludes.php on line 516

Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/bluegree/public_html/buttons/glassy.php on line 332

HELP ;)

I am on a linux remote host at: www.bluegreentechnologies.com/buttons

have gone through: Question #114749 on one attempt

1 - do i need to make a file called "font.scales", if so what do i put in it?
2 - I obviously need to change
(/usr/share/fonts/default/TrueType/fonts.scale)
to my environment such as
/home/bluegree/public_html/buttons/fonts
i guess this would be line 98 in buttonincludes:

// define some paths
define ('FONTPATH', '/usr/share/fonts/default/TrueType/');

next ... not sure yet ... any suggestions welcome

Question information

Language:
English Edit question
Status:
Answered
For:
buttonmill Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Matthew Ritchie (matthewjohnritchie) said :
#1

I just ound this too:

  // produce a temporary image file
  $deletetemppath = $defaultzipexists ? tempnam(IMGPATH, "") : IMGPATH."/".basename(DEFAULTZIP,".zip");
  $tmpimgpath = $deletetemppath."d";
  mkdir($tmpimgpath, 0700);
  $imgpath = $tmpimgpath."/button_0.png";
  $gifimgpath = $tmpimgpath."/button_0.gif";
  $jpgimgpath = $tmpimgpath."/button_0.jpg";
  $rimgpath = $tmpimgpath."/button_1.png";
  $rgifimgpath = $tmpimgpath."/button_1.gif";
  $rjpgimgpath = $tmpimgpath."/button_1.jpg";
  $readmepath = $tmpimgpath."/".READMENAME;

the zip files i dwnld from your site only contain jpg and png files........... are the gif files also available???
or by running on my own site will I get gif files as these are what I am after

Revision history for this message
Eric Dennison (ericd-netdenizen) said :
#2

The initial release of buttonmill (which you have downloaded) includes full support for gif generation, but also a very awkward scheme for loading fonts (as you have discovered). I have just released a tarball for the current revision of buttonmill which is identical to what is running at buttonmill.com. This release has a much simpler system for loading fonts (just point to the system fonts folder .. no fonts.scale file needed), but NO gif support. For general use I recommend using png anyway, but if you would really like the gif versions you will have to use the gif support in the initial release and combine it with the simplified font support in the latest release.

I would suggest getting the latest release running first, then make the few modifications needed to introduce gif support.

As you have discovered, this is software does not have a point-n-click installation like wordpress :)

Revision history for this message
Richard Virtue (rvirtue) said :
#3

As Mr Dennison points out, this software doesn't come with an automated setup like Wordpress and even the latest revision does have a few "quirks" to watch for. So, here are a few helpful hints for anyone else who may download the Creative Commons release here for installation on their own site.

REQUIREMENTS:

This web application has been designed with exec and shell_exec calls to "convert", "mogrify" and "unzip". The relevant functions therefore rely on the presence of ImageMagick and unzip executables in the environment path with necessary permissions. Only minimal changes are required to substitute zip_read() and zip_entry_read() functions for the shell_exec("unzip -p ...") calls. Any attempt to replace the ImageMagick calls, however, would require some very major revisions to the PHP coding.

INSTALLATION:

For most people with recommended php.ini production settings, the main glassy.php file should require no changes at all. But if you have set your php.ini to report all errors (on a development server, for example), you will see quite a few due to the use of unset variables (e.g. $dummy) and global array indexes that are either undefined or not properly specifed as strings (e.g., $_REQUEST[COLOR]). In addition, one of the glassy.php file's get_zip_data() calls is missing one of the eight (8) parameters expected for that function call.

The buttonincludes.php file MUST be edited to properly define the BASEURL constant. In most cases it can be set based on $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME']. This should be done prior to first usage and its creation of the defaultglassy.zip file. Failure to do so will cause problems with the "Recent Buttons" feature. Most other defaults that are set in the buttonincludes.php file should work without changes. Once again, however, errors may be seen on development servers due to one constant (STOCKIMGPATH) being defined twice and the use of incorrectly specified global array indexes (e.g., $_SERVER[ REQUEST_URI ] instead of $_SERVER['REQUEST_URI']).

If running on a server where $_SERVER['REQUEST_URI'] is undefined, insert the following at or near the top of the buttonincludes.php file:
<?php
if (!isset($_SERVER['REQUEST_URI'])) {
  $_SERVER['REQUEST_URI'] = getenv('SCRIPT_NAME');
  if (isset($_SERVER['QUERY_STRING'])) $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
}
?>

OTHER:

Because some temporary file names generated by the tempnam() function may contain more that a single dot, it may be advisable to modify the image.php file slightly in order to handle that possibility. Simply edit the lines that set the $imgselect and $imgext variables to use strrpos() instead of strpos() as follows:
  $imgselect = @substr($basefname,strrpos($basefname, ".")-1,1);
  $imgext = @substr($basefname,strrpos($basefname, ".")+1,3);

The recent.php file also contains some undefined or improperly specified global array indexes that may generate errors in some case. They can be avoided with the following changes to that file:
lines 39 and 40 -
  $startindex = isset($_REQUEST['start']) ? $_REQUEST['start'] : "0";
  $buttonsperpage = isset($_REQUEST['buttonsperpage']) ? $_REQUEST['buttonsperpage'] : defaultperpage;
line 82 -
  $imgbaseurl = "http://".BASEURL.$_SERVER['REQUEST_URI'];

Revision history for this message
Eric Dennison (ericd-netdenizen) said :
#4

Richard,

Thank you very much for writing this summary. I would very much like to
release these cleanups as well as the multi-line support that you have
shared with me, but I'm a little short on time. I *do* intend to do this at
some point and you have made that job vastly easier for me when I get to it
(which probably won't be until the summer when I have a couple of months
off).

So.. I just wanted to say THANK YOU for helping!

-Eric

On Tue, Jan 4, 2011 at 7:22 AM, Richard Virtue <
<email address hidden>> wrote:

> Question #122873 on buttonmill changed:
> https://answers.launchpad.net/buttonmill/+question/122873
>
> Richard Virtue proposed the following answer:
> As Mr Dennison points out, this software doesn't come with an automated
> setup like Wordpress and even the latest revision does have a few
> "quirks" to watch for. So, here are a few helpful hints for anyone else
> who may download the Creative Commons release here for installation on
> their own site.
>
> REQUIREMENTS:
>
> This web application has been designed with exec and shell_exec calls to
> "convert", "mogrify" and "unzip". The relevant functions therefore rely
> on the presence of ImageMagick and unzip executables in the environment
> path with necessary permissions. Only minimal changes are required to
> substitute zip_read() and zip_entry_read() functions for the
> shell_exec("unzip -p ...") calls. Any attempt to replace the ImageMagick
> calls, however, would require some very major revisions to the PHP
> coding.
>
> INSTALLATION:
>
> For most people with recommended php.ini production settings, the main
> glassy.php file should require no changes at all. But if you have set
> your php.ini to report all errors (on a development server, for
> example), you will see quite a few due to the use of unset variables
> (e.g. $dummy) and global array indexes that are either undefined or not
> properly specifed as strings (e.g., $_REQUEST[COLOR]). In addition, one
> of the glassy.php file's get_zip_data() calls is missing one of the
> eight (8) parameters expected for that function call.
>
> The buttonincludes.php file MUST be edited to properly define the
> BASEURL constant. In most cases it can be set based on
> $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME']. This should be done
> prior to first usage and its creation of the defaultglassy.zip file.
> Failure to do so will cause problems with the "Recent Buttons" feature.
> Most other defaults that are set in the buttonincludes.php file should
> work without changes. Once again, however, errors may be seen on
> development servers due to one constant (STOCKIMGPATH) being defined
> twice and the use of incorrectly specified global array indexes (e.g.,
> $_SERVER[ REQUEST_URI ] instead of $_SERVER['REQUEST_URI']).
>
> If running on a server where $_SERVER['REQUEST_URI'] is undefined, insert
> the following at or near the top of the buttonincludes.php file:
> <?php
> if (!isset($_SERVER['REQUEST_URI'])) {
> $_SERVER['REQUEST_URI'] = getenv('SCRIPT_NAME');
> if (isset($_SERVER['QUERY_STRING'])) $_SERVER['REQUEST_URI'] .=
> '?'.$_SERVER['QUERY_STRING'];
> }
> ?>
>
> OTHER:
>
> Because some temporary file names generated by the tempnam() function may
> contain more that a single dot, it may be advisable to modify the image.php
> file slightly in order to handle that possibility. Simply edit the lines
> that set the $imgselect and $imgext variables to use strrpos() instead of
> strpos() as follows:
> $imgselect = @substr($basefname,strrpos($basefname, ".")-1,1);
> $imgext = @substr($basefname,strrpos($basefname, ".")+1,3);
>
> The recent.php file also contains some undefined or improperly specified
> global array indexes that may generate errors in some case. They can be
> avoided with the following changes to that file:
> lines 39 and 40 -
> $startindex = isset($_REQUEST['start']) ? $_REQUEST['start'] : "0";
> $buttonsperpage = isset($_REQUEST['buttonsperpage']) ?
> $_REQUEST['buttonsperpage'] : defaultperpage;
> line 82 -
> $imgbaseurl = "http://".BASEURL.$_SERVER['REQUEST_URI'];
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Can you help with this problem?

Provide an answer of your own, or ask Matthew Ritchie for more information if necessary.

To post a message you must log in.