Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello, i found this here in my error Log...is this advagg Bug or something misconfigured ?
2013/09/02 05:33:41 [error] 11731#0: *1014 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to undefined function jsmin() in /var/www/xxx/sites/all/modules/advagg/advagg_js_compress/advagg_js_compress.advagg.inc on line 207" while reading response header from upstream, client: xxx.xxx.xx.xxx, server: www.example.de, request: "POST /httprl_async_function_callback?count=4 HTTP/1.0", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "www.example.de"
Comments
Comment #1
Peter Bowey CreditAttribution: Peter Bowey commentedHi eule
This indicates that the added jsmin() library does not exist!
Realize that this library can be either compiled into php, or added as a PHP extension.
The notes from advagg, for adding the jsmin() feature, have these notes:
The easier path for adding this is explained here:
Download the source, then run the following commands:
I usually compile the jsmin.c library direct into PHP.
Comment #2
Peter Bowey CreditAttribution: Peter Bowey commented@eule - a simple way to indicate that the jsmin extension exists is to run:
php-fpm -m
assuming you are using php-fpm as the 'non-cli' php process for html access.
Comment #3
eule CreditAttribution: eule commentedhi Peter, i use php5-fpm
Comment #4
Peter Bowey CreditAttribution: Peter Bowey commented@eule
That is fine, just run the command below:
php5-fpm -m
This will print to the console a list of PHP extensions currently installed!
If you have successfully added jsmin, as you require for advagg, you will note jsmin exists in the printed list.
If the list of php extensions is very long, then use
php5-fpm -m | grep jsmin
Notes: the
php(-xxx) -m
is used to show compiled in modules (or added extensions)Example #1 Printing built in (and loaded) PHP and Zend modules
Comment #5
eule CreditAttribution: eule commentedseems to me i lost the install over a backup..many thanks for your response!
Comment #6
Peter Bowey CreditAttribution: Peter Bowey commentedHi @eule
Glad to share / assist.
nginx, advagg and php-fpm are great tools to understand and use.
I have utilized all the above, and with much time spent on them.
I can gladly encourage you to do likewise... The outcome is worth the time.
Comment #7
eule CreditAttribution: eule commentedInstalling shared extensions: /usr/lib/php5/20090626/
i have this .so also in my php.ini added
but if i reload / or restart i dont find it
xxx@xxxx:~# service php5-fpm restart
xxx@xxxx:~# php5-fpm -m
[PHP Modules]
apc
bcmath
bz2
calendar
cgi-fcgi
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
memcache
mhash
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
uploadprogress
wddx
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
Comment #8
eule CreditAttribution: eule commentedif i do xxx@xxxx:~# php5-fpm -m | grep jsmin
i become this warnings
[02-Sep-2013 14:00:40] NOTICE: PHP message: PHP Warning: Module 'apc' already loaded in Unknown on line 0
[02-Sep-2013 14:00:40] NOTICE: PHP message: PHP Warning: Module 'memcache' already loaded in Unknown on line 0
[02-Sep-2013 14:00:40] NOTICE: PHP message: PHP Warning: Module 'memcache' already loaded in Unknown on line 0
Comment #9
eule CreditAttribution: eule commentedphp5-fpm.log
[02-Sep-2013 05:21:46] NOTICE: Reloading in progress ...
[02-Sep-2013 05:21:46] NOTICE: reloading: execvp("/usr/sbin/php5-fpm", {"/usr/sbin/php5-fpm", "--fpm-config", "/etc/php5/fpm/php-fpm.conf"})
[02-Sep-2013 05:21:46] NOTICE: PHP message: PHP Warning: Module 'apc' already loaded in Unknown on line 0
[02-Sep-2013 05:21:46] NOTICE: PHP message: PHP Warning: Module 'memcache' already loaded in Unknown on line 0
[02-Sep-2013 05:21:46] NOTICE: PHP message: PHP Warning: Module 'memcache' already loaded in Unknown on line 0
[02-Sep-2013 05:21:46] NOTICE: using inherited socket fd=7, "/tmp/php-fpm.sock"
[02-Sep-2013 05:21:46] NOTICE: using inherited socket fd=7, "/tmp/php-fpm.sock"
[02-Sep-2013 05:21:46] NOTICE: fpm is running, pid 1xxx1
Comment #10
Peter Bowey CreditAttribution: Peter Bowey commented@eule,
When running the CLI version of PHP from the command line, you may receive errors like the following:
Cause
It means that you have already activated the 'PHP' apc.so and the memcache.so extension. (read on further!)
You will need check the 'second module' activation that is occurring.
There are two ways to load most extensions in PHP. 1) One is by compiling the extension directly into the PHP binary (this is the way I generally add extensions). 2) The other is by loading a shared PHP extension dynamically via an PHP ini file.
The errors given [above] indicate that dynamic extensions are being loaded via .ini files, even though they are already compiled into the PHP binary.
Fix
To fix this problem, you can edit your php.ini (or extensions.ini) file and comment-out the extensions that are already compiled-in. For example, after editing, your php ini file may look like the lines below:
You may also erase those lines instead of commenting them out. Once you have disabled those lines, run php -v to see if the warnings are removed.
Additional Info
To see which extensions are compiled-in to your PHP binary, run the following command:
php -m
You can also view the configure command, which will show which extensions are enabled and compiled-in, or built as shared, dynamic modules.
php -i | grep Configure
The dynamic extensions are usually located in a special "extensions" folder, which varies by operating system environment. Your php.ini usually has a line that describes where the folder is located. For example:
You will find that an upgrade added a php.d directory containing a apc.ini that also loaded the apc module. Commenting out the extension loading in php.ini is required.
Comment #11
Peter Bowey CreditAttribution: Peter Bowey commented@eule
You have added the 'expected'
extensions=jsmin.so
to your php.ini.However, if it is *not* reported by the process
php5-fpm -m
, then it [jsmin] does not exist for you to use. [as a jsmin.c extension - or the library compiled into PHP itself].You have the tools, at hand, to make this occur. Read through the previous notes of how to add the jsmin.c library - either by a PHP extension, or compiling directly into your php.
If you need notes on how it could be compiled directly into PHP, then please ask. But you will need knowledge of compiling PHP 5.x, and a recent GCC [compiler].
To simply add the extension, to your PHP, requires this step:
Download zxf php-jsmin-1.0.tgz - or use the more recent version of JSMin+ version 1.4 (also see: https://drupal.org/node/1229324 )
Comment #12
eule CreditAttribution: eule commentedHi Peter, i get it here not loaded: i try all the stuff you write but nothing. I´m on Ubuntu makes this any sense?
i have here a Dir ./etc/php5/conf.d where are some of the .ini files and only when i here outcomment the line extension=apc.so in the apc.ini i dont become PHP message: PHP Warning: Module 'apc' already loaded.
i try also to make a jsmin.ini and add extensions=jsmin.so here. but
php -m
shows not the extension loaded. so my question how i can compiled the stuff into the PHP binary? maybe i have more luckComment #13
Peter Bowey CreditAttribution: Peter Bowey commented@eule,
I did guess that you might have Ubuntu ;-)
1)
This is a good step = well done.
2) Ubuntu usually only requires the "extension=jsmin.so" added in the php ini. To further clarify, here are the known 'Ubuntu' steps for adding jsmin.c:
First, download the given jsmin.c file into a directory.
or use the more recent version...
$ wget http://tweakimg.net/files/upload/jsminplus-1.4.zip
For the next step you'll need to make sure you have installed the gcc compilers for Ubuntu, if you have not already done this, then do:
$ sudo apt-get install gcc
Compile the file.
$ cc jsmin.c -o jsmin
You can leave the compiled file in your home directory, but if you think you're going to keep it around I suggest moving it to /usr/local/lib/jsmin/ and creating a symbolic link from /usr/local/bin/
Now, to use it! The below assumes you haven't moved it from your home directory. If you have, then the ~/jsmin/ path is unnecessary.
$ ~/jsmin/jsmin < my_javascript.src.js > my_javascript.min.js
That's pretty much all there is to it.
Comment #14
eule CreditAttribution: eule commentedhi Peter...sorry i get into a automatic sleep mode, I'm just simply tipped backwards ;-)
i do now all you write up but i get the next error :/ if i want to compile it i run into this
jsmin.c:59:17: fatal error: php.h: No such file or directory
sounds like i need a php.dev installed?
and in the 1.4 i found only a .php file
Comment #15
Peter Bowey CreditAttribution: Peter Bowey commentedHi @eule,
You need the php-dev package (for php.h). php is the binary package while php-dev contains source files.
Notes: PCRE is a dependency for installing php shared extensions. You can install it with:
yum install pcre-devel or apt-get install libpcre3-dev
the following packages are often required: (php extensions)
sudo apt-get install php5-pear php5-dev libpcre3-dev
Comment #16
eule CreditAttribution: eule commentedhi peter
i´m not really sure but i think Debian would be the better choice.
xxx@xxxx:~# apt-get install php5-pear php5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5-pear
I think I had installed php-pear times ago
Comment #17
Peter Bowey CreditAttribution: Peter Bowey commented@eule,
You may not need php-pear to compile the jsmin.c as a php extension....
The important requirement is within the
php5-dev + libpcre3-dev -> (php.h)
For interest sake, the
is sometimes caused by having installed / updated php5 beyond the version the Ubuntu package manager expects:
Comment #18
Peter Bowey CreditAttribution: Peter Bowey commented@eule,
Another thought on the given Ubuntu package issues:
Not all packages are prefixed with
php5-*
, some arephp-*
APC for example is
php-apc
PEAR may also be
php-pear
Comment #19
Peter Bowey CreditAttribution: Peter Bowey commented@eule,
Ubuntu sometimes shows this 'package' problem if a
libapache2-mod-php5
in the original installation is conflicting.Comment #20
eule CreditAttribution: eule commentedHi @Peter
thanks for your Help Peter, but i think i get it never working: i have never touched apache stuff. this is was i have installed on the clean machine
apt-get install nginx php5-cli php5-mysql php5-fpm php5-cgi php5-gd php-pear libpcre3-dev
Comment #21
Peter Bowey CreditAttribution: Peter Bowey commentedHi @eule,
I am sorry it has been such a trial!
Ubuntu is based on Debian and one event I dislike with Debian is that sometimes the official (stable) packages are far behind what vendors provide. Fortunately for both Debian and Ubuntu you can use the dotdeb repository, which is 'more up to date' with the popular packages (such as mysql, php, etc). If you are not familiar with this repository yet, please take a look at dotdeb repository (or directly via their setup instructions) and install PHP and related packages from there.
If any package is missing, here are some step-by-step instruction on how to make the package yourself.
Comment #22
Peter Bowey CreditAttribution: Peter Bowey commented@eule,
1) A wild guess really, but if you are using the Nginx version of XAMPP, then read this:
2) If you are using a standard Ubuntu, with stable release PHP, NGINX, and PHP5-FPM, then you only need to do:
sudo apt-get install -f php5-dev
, then the jsmin.c GCC compile.Notes: php5-dev contains files to develop PHP modules.
The command - below;
apt-cache search php
will show the differences:
Comment #23
eule CreditAttribution: eule commentedHi Peter
it´s all here...
apt-get install -f php5-dev
apt-cache search php
i try again
you write:
the DIR /opt/ is here but still empty
Comment #24
Peter Bowey CreditAttribution: Peter Bowey commentedHi @eule
Let us see if the needed
php.h
file exists on your Ubuntu system.At the Linux Prompt enter:
find / -name 'php.h'
My Fedora Linux shows this result:
Have you setup a 'build' environment for php?
For Ubuntu, the php.h file is normally found at:
/usr/include/php5/main/php.h
New advagg+jsmin Update @ September 4th 2013:
for advagg + jsmin: It might help to read the recent notes here -> Recommend pecl-jsmin if php >= 5.3.10
This new version of jsmin should be easier to install as a 'php pecl' add-on.
You can install this extension by using the pecl command:
pecl install jsmin-beta
Comment #25
eule CreditAttribution: eule commentedyou guys rule!
my php.h file is here i found it with the command you given.
install the jsmin-beta looks good!
i add also the extension now its right?
Comment #26
eule CreditAttribution: eule commentednot sure i´m done?
Comment #27
eule CreditAttribution: eule commentedi wish to spend you guys money..but i don´t have it yet. maybe some day ;D
i get the checkbox!
so it looks to work now, but i get 2 times guru meditation. i will digg
Thanks a Lot Guys!!! also @Peter Bowey and @mikeytown2 ..awesome!
Comment #28
mikeytown2 CreditAttribution: mikeytown2 commentedThanks @Peter Bowey for the support :)
Comment #29
biswajeetparida CreditAttribution: biswajeetparida commentedhi,
#24 work like a charm