Questions tagged [php]
PHP is a server-side scripting language designed primarily for web development. CiviCRM is written in PHP.
196
questions
0
votes
1
answer
84
views
Very slow mailing job with Mosaico with Imagick and UrlFilter.php errors
I have a problem where my mailing is being sent crazy slow, like hundred emails an hour. At the same time my cpu utilization is of the charts where apache2 is using like 99% of the cpu. In the php ...
5
votes
3
answers
294
views
Add custom field and populated with array/data from a non-civicrm table
newby here with a quick question about custom fields.
Is it possible to set up a custom field that queries a non-civicrm table?
Hoping to create an autocomplete dropdown menu that does a SELECT on a ...
0
votes
1
answer
201
views
PHP version matters or not?
I've been running certain 5.6 for a long while and wondering if I ever should migrate to 7.0 or just leave alone. Installation instructions say 7.0 is recommended but so is 5.6
Anyone have opinions ...
1
vote
0
answers
53
views
Migrate Jooomla installation to new server
Having a terrible time when changing server and updating Joomla and Civicrm. Apologize for the length of this post, but thought is would be helpful to anyone who can address my issues.
Here's the ...
0
votes
2
answers
242
views
Using Civicrm_api3 in onAjax[Name] plugin function
I created a plugin which provides custom validation for civicrm forms. Part of the jQuery validation on the plugin makes an AJAX call to the plugin. The plugin calls its onAjax[Name] method. In the ...
1
vote
1
answer
44
views
problem upgrading php
I updated to CiviCRM 4.7.28 (on Wordpress). However, I have not been able to update the PHP to the 5.6 version. In fact, after much searching, I don't seem to be able to come up with the correct way ...
0
votes
2
answers
175
views
How to catch Fatal error in civicrm?
I'm getting below error message while exporting csv file of 40k record.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65552 bytes) in /var/www/html/crf-git/modules/...
5
votes
1
answer
3k
views
Unexpected T_CLONE, expecting T_STRING (PHP 7, Drupal 7, Ubuntu 16.04)
On an Ubuntu 16.04 VM with PHP 7.x, I am seeing the following error when enabling CiviCRM in Drupal 7:
ParseError: syntax error, unexpected 'clone' (T_CLONE), expecting identifier (T_STRING) or '(' ...
1
vote
1
answer
1k
views
Any way to avoid "deprecated function" messages in the Drupal dblog?
I am getting a LOT of entries in the Drupal dblog (watchdog) about a deprecated PHP function, as described here -
Debug PseudoConstant
I'm trying to debug a different issue and the presence of these ...
6
votes
2
answers
275
views
What are the minimum and recommended changes to CiviCRM to support PHP 7?
To pragmatically help CiviCRM step-by-step to support PHP7 I would like to know what the minimum and recommended changes to CiviCRM to support PHP 7?
This will help developers to identify areas of ...
2
votes
2
answers
83
views
PHP is being updated from version 5.5 to 5.6
My host is upgrading php from version 5.5 to 5.6 next week. I am running wordpress v 4.5.3 and civicrm v 4.7.10. Should I be concerned about anything going wrong with the running of my site after ...
1
vote
3
answers
41
views
Issue with custom report that shows all users registered for event in last 2 years but not this year
I am using Drupal 7 and CiviCRM 4.6.28.
I am trying to create a report that will display all of the users who registered for an event in 2015 and 2016, but not yet in 2017. I have the report working ...
1
vote
2
answers
83
views
How to extract field from an array returned from an API3 call
I am trying to extract a custom field from a contact record. The API returns an array of the following form:
Array (
[0] => 0
[1] => 3
[2] => array (
[0] => array (
...
0
votes
1
answer
60
views
How to echo "Hello World" in civicrm?
I need to echo "hello world" in civicrm how to do this in any page in civicrm? i'm trying to do this using hooks_civicrm_post but there is no result.
1
vote
0
answers
186
views
Duplicate Entry UI_External_Identifier MySQL Error
Everytime I try to import a backup of my CiviCRM sql database, I always get an error: #1062 - Duplicate entry '' for key 'UI_external_identifier' in phpmyadmin (4.7.0, PHP version: 7.1.4, mysql 5).
I ...
3
votes
2
answers
599
views
Where is the exact path to the ConfigAndLog log *file*?
In the latest awesome pattern we can now locate our log service easily:
Civi::log()->info('Hello, log!');
And then we can tail the log which is in our ConfigAndLog directory. Chris has enumerated ...
5
votes
3
answers
763
views
Unable to install extensions: HTTP redirection error
I'm unable to install CiviCRM extensions from CiviCRM » Administer CiviCRM. On the CiviCRM extensions page I get the following error:
WARNING: The downloader may be unable to download files which ...
0
votes
1
answer
89
views
Debugging SQL - possible database problem
This is possibly a question with much too deep technical aspects (SQL, PHP and Civi-innards...) for this forum, but I don't know where else to start, so here goes.
I am experiencing mysterious ...
2
votes
1
answer
187
views
“MySQL support not included in PHP”
I have drupal running perfectly; with mysql support. But CiviCRM still giving me this error - “MySQL support not included in PHP.”
My PHP version is 5.6.31, as indicated in the screenshot below.
2
votes
2
answers
300
views
building an extension: how can I create a multiple-step form?
If I just had .php files I would do the following:
step1.php's submit button goes to step2.php. step2.php's submit button goes to step3.php, etc.
The problem is that I need data that the user entered ...
2
votes
2
answers
95
views
Buildkit Site fails to load due to PHP ugrade from 5 to 7
After Upgrading from php 5.6 to php 7, when i try to access the sites created using buildkit, I am unable to access it.
After typing
Civibuild show dmaster
I get the following
ERROR: Failed to find ...
1
vote
1
answer
907
views
Call to undefined function dl() error w/Joomla 3.5.1 & PHP 7
I've just installed CiviCRM on a Joomla 3.5.1 site to learn how to use it.
I am seeing an issue that I have a question about.
As long as I use Php 5.6 the installation works properly. If I try to ...
3
votes
1
answer
155
views
Need help upgrading 4.4.5 to 4.7.18 0n Ubuntu 16.04 server with PHP 7 on Drupal 7
The VPS host running Drupal/CiviCRM was upgraded from Ubuntu 14 LTS to 16 LTS. That ran without error. However, that upgrade came with PHP7. immediately after the upgrade all three CiviCRM sites ...
4
votes
2
answers
668
views
Is CiviCRM 4.6.x compatible with PHP 7?
Is CiviCRM 4.6.x compatible with newer version of PHP, 7?
1
vote
1
answer
79
views
cron.php display warning in error_log
running CiviCRM 4.7.8 WordPress
The following is appearing in the error_log whenever cron.php runs:
[Fri Jun 24 16:01:06 2016] [error] [client ...] PHP Warning: date(): It is not safe to rely on the ...
11
votes
5
answers
643
views
Is CiviCRM compatible with Nginx?
If I have PHP installed on nginx, and Wordpress installed too, can I still run CiviCRM as a Wordpress Plugin?
1
vote
1
answer
56
views
How do I examine the symfony event handlers that are active?
The API kernel uses a symfony event system at it's heart.
How on earth do I find out where all those events are going?
2
votes
0
answers
30
views
CRON Error: Trying to get property of non-object in /.../libraries/joomla/session/handler/joomla.php on line 74 [duplicate]
How do I resolve this error, 'Trying to get property of non-object in /.../libraries/joomla/session/handler/joomla.php on line 74'? Here's line 74 or the joomla.php file, $cookie = $this->input->...
0
votes
1
answer
41
views
Using data from CiviCRM to change filename
Here is what I need to do:
The user uploads an image, and I need to change the filename of the image to be firstname_lastname.filtype.
The first and lastname are stored within CiviCRM, but the ...
1
vote
1
answer
347
views
New install, system status says "cron not running" and "timestamp mismatch"
Running CiviCRM 4.7 on WordPress 4.7.3, hosted on a shared Linux server at 1and1.com. The WordPress site is using PHP 7.0 but apparently the latest version I can use from the command line is 5.5.
Two ...
0
votes
2
answers
63
views
Logged out periodically for unknown reason and word replacement not working
On one of the CiviCRM sites I've set up, it keeps logging me out every 30 minutes or so. I have set the cookies in the default.settings.php file so that I'm logged out when I close the browser but it'...
3
votes
3
answers
146
views
civix civicrm:ping not printing any output
I am running CiviCRM on Mac OSX 10.11.3, using the latest Bitnami CiviCRM/Drupal stack (bitnami-civicrm-4.6.11-0-osx-x86_64).
I have civix-15.04.1 installed as instructed (under $HOME/civix), and ...
2
votes
1
answer
174
views
Drupal - MySQL support not included in PHP
I am getting the following error on install of CiviCRM:
PHP Configuration
MySQL support MySQL support not included in PHP.
I am running:
CENTOS 6.8
Apache 2.4.18
Drupal 7.54
CiviCRM 4.7.16
...
2
votes
1
answer
44
views
PHP libraries in extensions
I've seen the conversation at: https://forum.civicrm.org/index.php?topic=27981.0. But I was wondering if anyone had experienced successfully embedding a PHP library in an extension.
Specifically I ...
1
vote
0
answers
89
views
How to spoof users to unit test ACL logic
Starting to think about unit testing access control permission logic in API calls.
Is there an established pattern for this?
Within CiviUnitTestCase and ACLPermissionTest there are these snips:
...
5
votes
1
answer
10k
views
SOLVED: 'DB Error: extension not found' after PHP upgrade to version 7.0
Civi: 4.7.11
Wordpress 4.7.2
Hi,
I was working on my database today and munged something up. No problem (I thought)... I did a back up beforehand just in case. Unfortunately, after restoring the ...
2
votes
1
answer
100
views
BAO vs API layer
I'm started to look at both the API and BAO classes.
It seems there is a degree of scope overlap for the business logic.
It seems to me that most logic should live in the BAO - but am I missing ...
1
vote
1
answer
31
views
Help with Drupal upgrade
I currently use Drupal 7.5.3 and need to upgrade to 7.5.4. Running it with CiviCRM. I'm a novice with this site and need a little hand holding to figure this out. Basically the site admin is AWOL and ...
5
votes
2
answers
458
views
Class naming and namespaces: best practice as an extension author?
Noting these related questions
(1
2
3)
and these two wiki pages
(1
2)
and the psr-0 standard, I remain a bit lost about current best practice in CiviCRM extensions!
So if I have an extenstion org....
1
vote
1
answer
20
views
Hook permissions `type`
Looking at hook_civicrm_aclWhereClause I see there is a $type parameter but there is currently no documentation for this type.
What are the allowed values?
5
votes
2
answers
145
views
How much symfony do I need to learn if I am going to be a CiviCRM core hacker?
I'm bit of a CiviCRM noob, but I'd like to help out and fit with the current patterns. I keep encountering bits of Symfony in core code and it seems well respected... and pretty cool.
So far I have ...
0
votes
2
answers
142
views
How do I write unit tests for time based actions?
If I have an delayed action in my code then how on Earth can I unit test this?
For example a membership transition?
3
votes
1
answer
130
views
What are `*.mgd.php` files for?
Browsing through a civix generated file I see it globbing for *.mgd.php files?
What are these files all about then??
5
votes
3
answers
507
views
How to speed up CiviCRM 4.7 php execution time
Anyone have an idea of how to speed up CiviCRM PHP execution time ?
I'm an administrator of CiviCRM on Wordpress production set-up, and I find it too slow. I've conducted a little investigation using ...
3
votes
1
answer
73
views
Smarty and future proof code
I am trying to be a more conforming civicrm coder.
Smarty used by civicrm for pages (and forms?)
I have never used Smarty.. Is it going to be part of civicrm going forward? And are there any tips ...
1
vote
1
answer
42
views
Tracked Opens No
Track opens stopped working recently. Clicking on tracked opens gnerates the following error message:
Fatal error: Class 'Database' not found in /home/xxxxxx/public_html/includes/bootstrap.inc on ...
1
vote
1
answer
38
views
Column deductible_amount not getting filled in on table civicrm_line_item
We use price fields/line items for all of our contributions. I noticed that on the line_item table the column deductible_amount is not filling in. I checked and Price Fields do not seem to have an ...
3
votes
1
answer
49
views
What are the core functions an extension can rely on?
It's been said, quite reasonably, that all APIs should have tests, and that if a feature doesn't have tests then coders shouldn't rely on it.
This raises two three questions:
other than direct "API3"...
0
votes
1
answer
150
views
PHP Warnings in maildir.php
Running Civicrm v4.7.14 on Wordpress v4.7 PHP v 5.6.29
For the last couple of weeks, I've been getting the following PHP warning emails, mostly hourly, from my host's server, after the CRON runs with ...
1
vote
3
answers
70
views
best practice for using core base functions (CRM_Utils_System_Base) from an extension?
CRM_Utils_System_Base defines a great set of key functions that look like they should work in any system.
What is the correct way to access this functionality within an extension?
FYI these are the ...