php-5.4

string concatenation with constants

☆樱花仙子☆ 提交于 2019-12-16 18:04:09
问题 I have only PHP 5.4 available at my current hoster and I always get errors with class constants in my code. Apparently, it's not allowed to define array constants. I changed the constant to a static variable to make it work. Now I get this syntax error: syntax error, unexpected '.', expecting ']' I try to define strings that consist of concatenated constants. public static $arr = [KEY_ONE => "string " . MyClass::CONSTANT . " string"] is this possible or do all constants have to be static

Class 'Memcached' not found-(php 5.4.9,windows 7)

若如初见. 提交于 2019-12-13 11:51:12
问题 I installed php-5.4.9(32 bit) on my windows 7 (64 bit machine) and configured it to run as a php-fpm process. I need memcached for my web application and hence installed memcached daemon and the necessary dll file in my php\ext folder. But when I try to run my web application folder I always get Class Memcached not found error. I tried googling and also referred to some stackoverflow but couldn't find the solution to my problem. Can somebody please help me understand what I am doing wrong?

What are the performance related issues of PHP curl

纵然是瞬间 提交于 2019-12-13 06:45:32
问题 My client wants to extract the html content of a live webpage and make a copy of the html page in his server. I am thinking of using curl and is there any performance issue linked when I am intending to use curl? Will it use a lot of server memory. If PHP curl has a performance issue, what is the best alternative to do this? I am intending to download the page when a user submits the web URl in a form. The server that I am hosting the web is in a linux platform. Thank you in advance! 回答1: I'd

Dreamweaver PHP array dereferencing

孤者浪人 提交于 2019-12-13 04:25:55
问题 I just installed PHP 5.4 and now that it supports array dereferencing I want to use that in my projects. Problem is that I'm working with Dreamweaver (CS6) and it gives me a syntax error for using the array brackets after the function parantheses. Is there any way to mess around with Dreamweaver's syntax support (or maybe just tuning the syntax highlighting in the configuration/CodeColoring directory may be enough)? 回答1: I would suggest to download another Editor if you work with PHP. Some

Problems with .htaccess after upgrading to PHP 5.4

非 Y 不嫁゛ 提交于 2019-12-12 02:44:53
问题 I have had some difficulties with my site after updating my servers to use PHP version 5.4.. I have been through a lot of support tickets and browsed the internet for 2 days.. Now I need to ask directly to the people who actually know about it. After updating the php version I started to get a 500 error on my pages and it turned out that my rewrite rules in my htaccess file wasn't working anylonger. They did in php version 5.2 but not in 5.4. <IfModule mod_rewrite.c> RewriteEngine On

DateTime class create a function to add hours onto a deadline taking into account working hours and on hold time

前提是你 提交于 2019-12-11 16:14:23
问题 Basically I am trying to create a basic case logging system and when somebody opens a new case, the case is assigned a priority with a given number of hours. For example priority 1 is 4 hours, 2 is 9 hours, 3 is 36hours and 4 is 63 hours. Now adding hours onto a time stamp is easy but the catch is I need to take into account working hours which are 08:30 to 17:30 Monday to Friday. So if a case is given a 4 hour priority and the deadline for this falls after 17:30 on a week day then the

mysqlnd driver has only one api extension (pdo_mysql)

我的梦境 提交于 2019-12-11 13:53:29
问题 After checking phpinfo() I saw that mysqlnd driver installed on linux (php 5.4) has only one API extension ( pdo_mysql ), but I also want to be able to work with mysqli . How do I associate mysqlnd driver with mysqli extension? I guess I can fix this by reinstalling mysql, but is there any workaround? Please help! Thank you! 回答1: Assuming that you did install mysql correctly. Locate your php.ini by executing phpinfo() or by typing the following command: php --ini look for something like

Paypal html button custom field limit

本小妞迷上赌 提交于 2019-12-11 00:27:31
问题 there is a limit of 256 characters on the custom field for a Paypal html button. Is there a way to increase that limit or are there other fields that I can user (like custom1, custom2, other), etc... Thank you 回答1: Instead of sending a whole load of data via the custom field, save the data in a database, and send a record id. On ipn / cancel, retrieve the ID and update/delete the record. To do this, 1st you need to change the button code to post to a php file on your own site not paypal, so

::class equivalent in PHP 5.4

旧街凉风 提交于 2019-12-10 15:58:29
问题 I've got a PHP script with the following line: $class = Connection::class; This runs as expected on PHP 5.5 as explained here: http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class. However, it causes a syntax error in PHP 5.4. Is there a simple way that I can rewrite this line to run in PHP 5.4? 回答1: See if this does it for you: $class = __NAMESPACE__ ."\\".get_class($connection_object); 来源: https://stackoverflow.com/questions/32525810/class-equivalent-in-php-5-4

Where can I find the bcompiler dll for xampp 1.8.2(PHP 5.4.X)

筅森魡賤 提交于 2019-12-08 19:23:08
问题 I am using xampp 1.8.2 on windows xp and bcompiler dll is not present in the ext directory. I installed older xampp(1.7.1) on windows XP and bcompiler dll was included in the ext directory. where can I find the bcompiler dll for xampp 1.8.2(PHP 5.4.X). The latest dll I could found on internet was for PHP 5.3.X. I saw some posts talking about compiling it using Microsoft SDK incuding Microsoft compilers, but I have no idea about it. Can somebody compile it and make it available for download