Questions tagged [php]
PHP is a server-side scripting language designed primarily for web development. CiviCRM is written in PHP.
196
questions
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 ...
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.
0
votes
1
answer
53
views
com_civicrm/civicrm/CRM/Core/BAO/SchemaHandler.php on line 730
Do you have any information about the solution of the error found in the image?
Joomla Version: 3.7.4
CiviCRM Version: 4.7.22
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 ...
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 ...
2
votes
1
answer
125
views
Using CiviCRM API in Drupal View
I am trying to use the Civi API within a Drupal view, in the global PHP field.
It is all working, except for when I try to use an "Available Variable" from the view, it throws and error. When I hard ...
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 ...
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->...
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 ...
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 ...
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?
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'...
5
votes
3
answers
21k
views
how do I use phpcbf?
When I run civilint in the build kit I get a long report which ends with this line:
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
Well that sounds great! Where is this mythical phpcbf ...
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 ...
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
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:
...
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 ...
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 ...
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 ...
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 ...
4
votes
1
answer
94
views
How to let extension users choose cache system?
CiviCRM contains some useful caching infrastructure (confluence wiki and related question).
If I am creating a module and I would like to allow users to override the default Civi::cache() ...
1
vote
2
answers
88
views
configuration variables: where is the documentation?
This is changing between 4.6 and 4.7.
Where is the best place to see what each setting does?
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 ...
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
0
answers
15
views
Email cant get retrieved in php
I use php in webform to redirect to an URL after the form is submitted
$email = [submission:values:civicrm_1_contact_1_fieldset_fieldset:civicrm_1_contact_1_email_email:nolabel];
header('Location: /...
0
votes
1
answer
240
views
Fatal Error on ClassLoader.php : undefined function stream_resolve_include_path()
Has anyone received the following Fatal Error when installing CiviCRM?
Fatal error: Call to undefined function stream_resolve_include_path() in
/var/www/html/devCivi/modules/civicrm/CRM/Core/...
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 ...
2
votes
1
answer
285
views
Dependency on php5.6-simplexml goes unchecked, is that a bug?
I'm trying to install CiviCRM 4.7.10 on Ubuntu 16.04/WordPress 4.6.1/PHP 5.6.
After completing the installation, when I try to open the CiviCRM node in the WordPress admin menu, I get an error 500 ...
2
votes
1
answer
147
views
"MySQL support not included in PHP error" in CiviCRM-4.7.10-wordpress
I'm getting the error "MySQL support not included in PHP" in the CiviCRM installer wordpress page.
My setup is:
Ubuntu 16.04
Wordpress 4.6.1
CiviCRM 4.7.10
php 7.0 with mysqli php extension ...
0
votes
1
answer
149
views
Profile sync using CiviCRM WordPress Profile Sync
Following use-case:
CiviCRM has many contacts, including contacts of individuals with the same primary email address (e.g. one corporate email, two
individuals (contacts) working there) -> forget ...
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 ...
7
votes
2
answers
64
views
Are there up-to-date CiviCRM coding standards available?
I am using NetBeans 8.1 under Windows to develop/debug some CiviCRM code. Previous attempts at getting the contribution accepted ran into trouble as they failed to comply with the coding standards. ...
2
votes
0
answers
62
views
Find contacts with multiple relationships of same type
We try to gather total number of users of same Relationship Type but different number of Relationships (mean, user can be a Member of no / 1 / 2 3 .. etc. Organisations).
Here's a code we use:
$...
0
votes
1
answer
1k
views
Copy old WAMP directory to new installation of WAMP
Can anyone assist with the following scenario please...
-I had a local install of Wordpress and CiviCRM using WAMP.
-PC died but I was able to retrieve the Hard Drive and install in another PC as a ...
0
votes
2
answers
37
views
iATS Extension Working, but Throwing Errors
iATS 1.5.3 is throwing the following errors (1.5.0 was too) on Civi 4.7.10 running under Drupal 7.50 on CentOS:
Notice: Undefined index: config_backend in _iats_civicrm_domain_info() (line 202 of /...
0
votes
1
answer
773
views
Configuring cron using PHP cli method results in Permission denied
Centos 7 with selinux set to permissive. Using apache as the user and confirmed apache has execute permissions to the folder and file in plugins/civicrm/civicrm/bin/cli.php
The crontab entry -
1 * * ...
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
0
answers
115
views
What are the recommended disable_functions for Civicrm, if any?
I've seen various security checklists suggesting the use of disable_functions in php.ini, giving a wide variety of functions to disable.
Is this a good practice with Civicrm, and if so, what are the ...
1
vote
3
answers
255
views
Where is include_path set?
I try to get rid of this persistent and annoying warning message:
Warning: is_dir(): open_basedir restriction in effect.
File(/usr/share/pear/api/v3) is not within the allowed path(s):
(/var/...
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 ...