Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

2015-08-07


For a fresh of taste I've installed Mac OS X El Captain(10.11) beta on my Macbook. Everything is fine until I want to upgrade my PHP installation via homebrew.

The result is:

> brew install php56
Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Installing php56 from homebrew/homebrew-php
==> Downloading https://php.net/get/php-5.6.11.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php56-5.6.11
==> ./configure --prefix=/usr/local/Cellar/php56/5.6.11_2 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc
==> make
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cgi/php-cgi] Error 1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/homebrew/homebrew-php/issues

Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.

According to the warning, that is not avoidable with build failure. ;-)

BUT, the problem can be solved with the power of google. :)

---

Open the File /usr/local/Library/Taps/homebrew/homebrew-php/Abstract/abstract-php.rb line 362, replace:
s.change_make_var! "EXTRA_LIBS", "\\1 -lstdc++"
to
s.change_make_var! "EXTRA_LIBS", "\\1 -lstdc++ /usr/local/opt/openssl/lib/libssl.dylib /usr/local/opt/openssl/lib/libcrypto.dylib"

then try to install the php via homebrew again.

via: https://github.com/Homebrew/homebrew-php/issues/1941

2008-01-02

Fatal error: Allowed memory size of xxx bytes exhausted

Happy New Year to all!

2007 is already the past now. I hope I can keep writing in this new year 2008, not so lazy like in 2007. :)

So today's topic is a PHP error.

During a migration of a Drupal site, after I make a 100% copy of the test site to the new site and change every settings for the new one, then the new site shows me the terrible message!
Fatal error: Allowed memory size of 654321 bytes exhausted (tried to allocate 12345 bytes) in /srv/www/user/bla/blub/file.php on line 123
What goes wrong? The test site runs like a charm and the process of migration should be okay.

In PHP, there is a enviroment variable called memory_limit. It varies by your web hosting provider. By default it's 128M, namely 128 MB memory. Since the web hosting provider want to spare some hardware costs and provides more accounts on a shared server, so the value of memory_limit will be changed to 16M sometimes! If you are like me to use some modules in Drupal (that's what makes Drupal attractiver than others!), because every module will eat some memories, so your Drupal installation will reach the memory limit very soon!

Now here is the solution:

  1. Contact your web hosting provider to beg them for a bigger memory_limit, which is hard to be satisfied.
  2. Try to switch off some Drupal modules to save the memory. It can be done only through Database manipulation such as in PHPMyAdmin.

If you have to choose the second way:

Go to the table "system", you will find almost every module has a feld called "status". 0 means not selected, 1 means enabled. Try to set the status of some modules such as statistic, color, etc to 0. After that you should see your new site without the above error. If not, eh.... you must switch more modules off. What a pity!

Most important, after the DB manipulation you should go to administer -> site configuration -> modules to save your configuration and run the update.php, otherwise the Drupal will lose some module-special configuraions.

2007-07-14

Ajax RSS News Ticker

Today I want to introduce a very useful tool called "Advanced RSS Ticker"。 This tool uses a PHP class which can parse the RSS feed. The PHP class is Last RSS. Comparing to other PHP class, I think the most highlight is that it supports UTF-8. You may wonder, is there any RSS Parser which supports no UTF-8. Yes, there is ONE. I don't mention its name because it took me so many time to figure out that it is NOT UTF-8 compatible. :-)

You only need to download this and extract the zip into your web directory. Try the demo.htm within it, it is that easy!

There is also another PHP RSS News Parser. Since I didn't try it, I left it to you to compare this with the other two. ;-)

2007-05-23

Node template in Drupal

Drupal is one of my favorite CMS. For a recent project I need a plug-in that can duplicate a page or a branch of book nodes. Even more I want to set them as node templates, so that I can use them for further actions.

I've looked at so many modules of Drupal, but none of them meets my requirements. So...sadly I must do it myself. The result is, I wrote a module called "node template", which can be found at http://drupal.org/project/node_template.

It's my first module project for Drupal. So I hope I have more free time to make it better. Although setting up a CVS release of that module cost me already 30 minutes to figure it out, finally is it there. :)

2007-05-15

Best tutorials on Sending Email from Flash using PHP

I've tried a lot of tutorials on the web, in order to make a working contact form in flash. Endly I found one: Sending Email from Flash using PHP

The best part of that tutorial is: it points out tons of tips which could drive man crazy without. For example, you'd better hide the send button in a Movie Clip, so that everything works. Why? because otherweise

Note: note that [ send ] is a Movie Clip with inside a button. This is useful for us while with the loadVariables() our vars to PHP without sending all _root variables...
Reading such kind of tutorials is really an enjoy. Keep going on, Alessandro Crugnola!