php

recent posts related to the php programming language

Apache cannot restore segment prot after reloc

Problem

I got the following error message after trying to run apachectl start after installing PHP and the Apache httpd server:

Solved problem trying to configure PHP with GD support

Problem

I was just trying to install PHP from source code on a CentOS Linux box, specifically trying to configure PHP with GD support with a configure command like this:

./configure --with-apxs2=/usr/local/apache2/bin/apxs \
            --with-mysql \
            --with-gd

Unfortunately this configure command fails, ending with the following two lines of error output:

The PHP "headers already sent" error message

Still in my early days working with PHP, I've learned that it's really easy to generate the dreaded "headers already sent" error message. If for some reason you actually want to generate this error message intentionally, I've learned that all you have to do is try to send HTML body content (any non-header content) before calling the header() or setcookie() methods, and you'll get that PHP error message right away.

PHP redirect - How to send a redirect with PHP

PHP redirection FAQ: How can I redirect a user in a PHP script?

I've been working with OpenSSO a lot lately (Sun's open source identity management product), and one thing you see right away is that they redirect the user's browser a lot during the login process. During a typical login process a user will attempt to access a protected page; an OpenSSO agent will redirect the user's browser to the OpenSSO login page; and after a successful login they redirect you back to the protected resource.

OpenSSO and PHP - A PHP script to validate a user's OpenSSO cookie

PHP OpenSSO FAQ: Can you share a PHP script to validate a user's OpenSSO cookie?

PHP here document (heredoc) examples

PHP here doc FAQ: Can you share some examples of the PHP "here" doc (heredoc) syntax?

"Here" documents in many languages are provided as a way to address the following problems:

OpenSSO and PHP - PHP login scripts to manually authenticate OpenSSO users

PHP OpenSSO FAQ: Can you share a PHP script to manually authenticate OpenSSO users during a login process?

OpenSSO and PHP - A custom PHP script to manually log out of an OpenSSO single sign-on session

This blog post is part of a series of planned articles regarding OpenSSO and PHP, specifically how to use the OpenSSO Identity Services from within a PHP application.

OpenSSO and PHP - A simple PHP script to retrieve OpenSSO identity information

Here's a simple PHP program I wrote to test how PHP works with OpenSSO, specifically how it works with OpenSSO identity information.

I saved this file with the name info.php, then put it in a directory on my Apache web server that is protected by an OpenSSO login policy. To access this page, I enter the URL for the page in my browser and try to access it, with the URL being something like this:

Is there a package manager for PHP?

PHP FAQ: Is there a package manager for PHP?

Answer: Yes, PEAR (the PHP Extension and Application Repository) is what you need. As the website describes it, "PEAR is a framework and distribution system for reusable PHP components."

Here's an example of how I used PEAR to install the HTTP_Request library, showing both what I typed, and the output from PEAR as it performed the installation.

Syndicate content