Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#15909 closed defect (fixed)

freetype 2.3.7 / php5 5.2.6 - PHP imagettftext broken

Reported by: philip@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: imagettftext Cc: jyrkiwahlstedt, cabanela@…, mf2k (Frank Schima), simon@…, nox@…
Port: freetype php5 gd2

Description

building php5 with

port install php5 +apache +whatever

works fine, but calling PHP's imagettftext() causes apache2 to go crazy:

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
[Mon Jul 07 18:51:27 2008] [notice] child pid 67161 exit signal Trace/BPT trap (5)

http://discussions.apple.com/message.jspa?messageID=5705589 suggests to rebuild freetype with

--with-fsspec=no --with-fsref=no --with-quickdraw-toolbox=no --with-quickdraw-carbon=no

changing freetype's Portfile in line 50 to

#    --with-old-mac-fonts \
    --with-fsspec=no --with-fsref=no --with-quickdraw-toolbox=no --with-quickdraw-carbon=no 

and php5's Portfile in line 94 to

    --with-gd \

works. I know, the --with-old-mac-fonts was somehow important to some people and php5 now uses the bundled GD2, but I'm not too familiar with changing stuff in macports, so maybe someone else can, so all the freetype functions in php5 will work again.

Change History (16)

comment:1 Changed 16 years ago by philip@…

Cc: philip@… added

Cc Me!

comment:2 Changed 16 years ago by jmroot (Joshua Root)

Cc: jwa@… added; philip@… removed
Milestone: Port Bugs
Owner: changed from macports-tickets@… to ryandesign@…
Type: enhancementdefect

Assigning to maintainer.

comment:3 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: cabanela@… added
Status: newassigned

Has duplicates #16340 and #16341 which contain more info.

comment:4 Changed 16 years ago by mf2k (Frank Schima)

Cc: macsforever2000@… added

Cc Me!

comment:5 Changed 16 years ago by cabanela@…

Just knocking to see if anyone is considering making a freetype variant to disable old font support and allow me to use freetype on Leopard again.

comment:6 Changed 15 years ago by simon@…

I've just got stuck on this bug (and taken several hours to realise it was OSX/MacPorts related rather than either my code or PHP more generally). Any plans for fixing it, or are we waiting on some OS change?

comment:7 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: simon@… added
Port: freetype added

Someone just please tell me what to change and why. This ticket says to remove --with-old-mac-fonts and add --with-fsspec=no --with-fsref=no --with-quickdraw-toolbox=no --with-quickdraw-carbon=no. #16341 says I only need to add --with-quickdraw-toolbox=no --with-quickdraw-carbon=no. If someone could tell me definitively what configure options to add or remove, and what the implications of each change are, then I can commit something.

comment:8 Changed 15 years ago by blb@…

Doing

 configure.args \
-    --with-old-mac-fonts
+    --with-quickdraw-toolbox=no --with-quickdraw-carbon=no

gets PHP5 working here. I suppose those can be swapped back in a variant for those who still need them, maybe with a ui_msg warning or one in the description about the CoreFoundation+forking issue.

comment:9 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Ok. I'm inclined to not make a variant, but rather to make that change globally for darwin 9 and above, and leave things the way they are for darwin 8 and earlier.

comment:10 in reply to:  9 Changed 15 years ago by cabanela@…

Replying to ryandesign@…:

Ok. I'm inclined to not make a variant, but rather to make that change globally for darwin 9 and above, and leave things the way they are for darwin 8 and earlier.

Sounds like a reasonable solution, since this problem only seems to bite darwin9 users. If Apple fixes it later, then maybe it can become a variant.

comment:11 Changed 15 years ago by nox@…

Cc: nox@… added
Keywords: php5 freetype gd2 removed
Port: php5 gd2 added

comment:12 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

I finally did some testing myself, and it appears that the only thing I really need to change to get php's imagettftext() to work on Leopard when php is running as an apache module is to remove --with-old-mac-fonts. So now, as of r42513, that option is only used on Tiger and earlier. See comment 6 in ticket 13045 for why this hopefully won't be a problem.

comment:13 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

comment:14 Changed 15 years ago by nathanp@…

I'm still having issues with this, using the port for Freetype 2.3.8. The problem occurs for me when I try to load a font for use in PDFLib. I've rebuilt pdflib 7.0.3, PHP 5.2.9, and freetype 2.3.8 using macports, restarted apache and I'm still getting this error. I've manually added to freetype's Portfile --with-fsspec=no --with-fsref=no --with-quickdraw-toolbox=no --with-quickdraw-carbon=no. I'm not sure what else to try.

This is seriously annoying and its preventing me from working. Not sure how to proceed.

comment:15 in reply to:  14 Changed 15 years ago by nathanp@…

Replying to nathanp@…:

I'm still having issues with this, using the port for Freetype 2.3.8. The problem occurs for me when I try to load a font for use in PDFLib. I've rebuilt pdflib 7.0.3, PHP 5.2.9, and freetype 2.3.8 using macports, restarted apache and I'm still getting this error. I've manually added to freetype's Portfile --with-fsspec=no --with-fsref=no --with-quickdraw-toolbox=no --with-quickdraw-carbon=no. I'm not sure what else to try.

This is seriously annoying and its preventing me from working. Not sure how to proceed.

Disregard, this is a problem with Pdflib itself. Sorry for the spam. http%3A%2F%2Fwww.pdflib.com%2Ffileadmin%2Fpdflib%2Fpdf%2Fsupport%2FPDFlib-in-PHP-HowTo.pdf

comment:16 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.