- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
- (06/12) View Layer - Getting count of Entities in View in Cakephp 3TAGS:CakephpCake3
- (05/23) Changing URL in beforeRedirect() in Component - Cakephp 3TAGS:CakephpCake3Web Programming
- (01/28) Foundation CSS Framework ResourcesTAGS:FoundationCss
- (01/27) Change View File from Controller in CakePHP 3TAGS:CakephpCake3UsageWeb Programming
- (01/13) Loading Model/Table Anywhere in Cake3TAGS:Cake3Cakephp
- (10/06) CURL PHP 5.5 Issue on Windows (Using Twilio SDK)
Subscribe to my feed
Php Tagged Blog Posts
Posted on 07/08/2013 at 12:39 pm | Viewed 11,482 times | 0 comments
I've recently taken the plunge and learned about CSS Media Queries and Responsive Web Design. We launched a new ordering site and made the whole website, including the checkout process, mobile-friendly. It's really opened up my eyes to the possibilities of mobile web design. I started out wondering why responsive web design was all the rage, now I prefer to order and checkout using the new Site Avenger mobile shopping templates. It's pretty easy to retrofit with an existing Site Avenger website and all new E-Commerce websites have the option of being mobile-friendly from the start.
Posted on 06/18/2013 at 01:01 pm | Viewed 8,370 times | 0 comments
Get PHP File Uploads Working
The first trick to having any user contributed content these days is to get PHP File Uploads working (especially with big files). Our configuration we use for our Wamp local development and on our Linux server is below.
When managing file uploads to a server, there seems to be a lot of confusion regarding optimized PHP settings and configuration. We have had some experience with this that we would like to share.
Posted on 02/25/2013 at 01:33 pm | Viewed 42,286 times | 0 comments
Here is my list of optimizations and changes you can make (and I've had to make) in order to get WAMP (and CakePHP) to run faster on my Windows 8 computer.
Speed Up WAMP Web Development on Windows 8
The short list, in order of importance (stop once you are happy with your localhost web server response time and speed):
- Get the latest version of WAMP.
Start by downloading the latest wamp. I used the 64 bit version. Download WAMP here.
- Edit your hosts file.
Make sure it has the proper entries, and most importantly, remove the IPv6 localhost setting. Your Windows 8 hosts file should look like this:
# ::1 localhost
- Disable IP v6
A great tutorial can be found here. My advice is to disable IPv6 BOTH ways- via the network adapter and via the regedit hack.
- Edit Apahce httpd.conf.
These tweaks are supposed to speed up the lstat() system calls when reading files/scanning directories. They are:
- Edit PHP.ini
Increase the real path cache size. This helps when you have lots of files involved.
; Determines the size of the realpath cache to be used by PHP. This value should
; be increased on systems where PHP opens many files to reflect the quantity of
; the file operations performed.
realpath_cache_size = 24M
- CakePHP: make sure debug is off.
Posted on 01/14/2013 at 02:34 pm | Viewed 11,930 times | 0 comments
A common, recurring headache and complaint among Zend Lucene search processing is handling the data fields in search results.
We all like to be flexible and robust in handling the results, we may want our search to return news articles, blogs or webpage content.
Invariably, we run into problems, usually in the form of an exception
Posted on 12/28/2012 at 12:33 pm | Viewed 17,199 times | 0 comments
We have discovered in a recent implementation of Internationalization that GIT can corrupt the POEdit generated *.po and *.mo files.
Upon committing updated files GIT by default will replace the LF with CRLF in these files. These files cannot be tampered with after generation, even viewing the files with most windows based editor may corrupt them.
Posted on 06/28/2012 at 11:11 am | Viewed 9,961 times | 0 comments
I kept getting the White Screen of Death (WSOD). What we at Saco Design have appropriately named the behavior of the default blackhole Security Component setting. The weird issue was that I was getting the issue only on the live server. I had recently updated the live server's version of PHP to the latest 5.3.x release. However, I neglected to update my local PHP version, which was still 5.3.5.
Posted on 10/18/2010 at 06:34 pm | Viewed 10,304 times | 0 comments
In a depature from my [normally] on-topic (i.e. dry) posts I had to post this error message up here. It made me laugh! I was working on the fattest CakePHP controller known to man (over 4,000 lines, I know... not skinny) when Eclipse ran into issues. Eclipse gave a very descriptive error message, stating that it couldn't, well see for yourself:
Posted on 09/07/2010 at 08:17 pm | Viewed 9,758 times | 0 comments
Just a quick post to let everyone know what I just found out- the version of CURL (php_curl.dll) that ships with PHP 5.2.14 for Windows ISAPI doesn't work! That's right- it doesn't work. I tried the MSI PHP installer package, manual installs, moving dll files into Windows and System32 directories all to no avail. The culprit: a bad version of php_curl.dll (at least that's my best guess). The other culprit: using ISAPI, but I don't have time to figure out FastCGI at this point.
Posted on 05/29/2010 at 12:36 pm | Viewed 16,799 times | 5 comments
Posted on 05/28/2010 at 12:12 pm | Viewed 12,678 times | 1 comment
I came across a posting today that changed the performance of my application tremendously and reinforced a concept I had forgotten about- mysql indices. I didn't realize my app was running slow until I implemented the mysql indexes below- no formal benchmark testing, but I would say speed improved by about 300%. The improvement was most noticeble when you are building your ACL using the CakePHP suggested method.
Posted on 04/20/2010 at 04:42 pm | Viewed 15,226 times | 0 comments
I'm sure every developer reaches a point when they will need to use a mysql database of zip codes in the United States. Say you want to make a store locator and show how many miles a customer is from your store, or if you have some custom php logic that uses zip codes, you will inevitably need a mysql database of zipcodes.
Posted on 04/19/2010 at 04:27 pm | Viewed 21,327 times | 1 comment
I finally had a client request a piece of functionality that required me to program CakePHP so I could better control the default error handling when the site is in production mode (i.e. debug is set to 0). By default, CakePHP will throw a 404 page not found header whenever ANY errors occur on a production site with debug equal to zero. This works great, most of the time. But what about when you are having database connectivity issues? Say when there are too many mysql connections to that overloaded shared hosting box? Modifed CakePHP error handling to the rescue.
Posted on 03/22/2010 at 05:56 pm | Viewed 12,007 times | 1 comment
I've setup a form that allows customers to sign up for an email newsletter and receive a coupon. I wanted to be able to track the bounced messages in case a legitimate customer's coupon was bounced for whatever reason. As I've learned, setting up the "return-path" for an email message isn't as simple as setting $this->Email->return = 'email@example.com'; You have to use an as yet undocumented feature... $this->Email->additionalParams;
Posted on 03/16/2010 at 04:15 pm | Viewed 8,475 times | 0 comments
In writing a function to validate bank routing numbers, I came across two simple techniques, that I know I will need to use again:
PHP Trick 1: Remove All Characters Except Numbers from a String
A simple little regex does the trick:
$routingNumber = preg_replace('[\D]', '', $routingNumber);
Posted on 03/16/2010 at 04:10 pm | Viewed 14,598 times | 0 comments
Posted on 02/25/2010 at 02:44 pm | Viewed 16,127 times | 0 comments
Let's have some fun with PHP's break command... I didn't think it was possible. I just learned (I've been programming PHP for like 7 years) that you can instruct break how many levels of nesting to break out of! I'm not surprised that break in PHP allows you to specify the number of loops (or switch statements) to break out of, but I am surprised it took me this long to use it!
Posted on 12/15/2009 at 08:29 am | Viewed 29,389 times | 5 comments
I've been working on setting up a multi-lingual web site for one of my clients. I was excited at the opportunity to finally use CakePHP's built-in internationalization and locale functions. However, I ran into some issues that I'm sure other newbies to internationaliztion will run into as well. Here's some take-backs of what I learned while using the Translate Behavior in Cake...
Posted on 09/09/2009 at 02:26 pm | Viewed 8,483 times | 0 comments
I ran into an interesting issue with valid dates and MySQL on Windows. I wrote a CakePHP import function that basically moves MySQL data from one DB to the other. I never thought that I would see an error related to an invalid date, but I did.
What determines if a date value is invalid (read: warning) or unacceptable (read: error)?
Posted on 09/08/2009 at 09:31 pm | Viewed 9,502 times | 0 comments
If you haven't checked out CakePHP's Flay class, check it out. It's one of the best utility classes for text output in CakePHP.
I just noticed that my blog was using the same META description for all of my blog entries- not good for SEO. Instead, I want to pull a fragment of the article copy and use that as my META description. I currently use this convoluted way to get my summaries from the article copy, so I decided to try using the Flay class. I've used it before but I'm glad I revisited it... it's amazing!
Posted on 08/28/2009 at 09:40 am | Viewed 7,458 times | 0 comments
I'm trying to use the exif functions in PHP on my Windows XP computer. I want to read the meta data that is recorded by my digital camera (exif - exchangeable image file format). I like the idea of storing that exif data in the database, so it's searchable. I wasn't having any luck with exif_read_data(), but finally found this posting.
Posted on 08/25/2009 at 04:17 pm | Viewed 11,276 times | 0 comments
It's easy to change which file types are allowed to show up (and are displayed) when you browse for files to upload through SWF Upload. SWF Upload makes it easy to upload multiple files in PHP.
I just had to hunt through some source files until I found this in my SWF Upload config. (goes in the new SWFUpload() function)
Posted on 06/09/2009 at 10:18 am | Viewed 14,369 times | 1 comment
I wanted logged in users to be able to see the output from phpinfo(); within Site Avenger. The problem with using phpinfo() is that it outputs a full HTML page, CSS styles and all. In the past this has been fine, but now I wanted to show the phpinfo() within the Site Avenger layout and CSS styles. I came across a simple, yet highly effective solution...
Full Tag List
- Web Programming
- Site Avenger
- Empty Table
- Graphic Design
- Internet Marketing
- From The Hip
- Midcoast Magnet
- User Group
- Web Server Admin
- 404 Errors
- Web Design
- Internet Explorer
- Forum Answers
- Cakephp 13
- Jquery Ui
- Quick Tip