PHP Parse error: syntax error, unexpected $end

The following error may appear in your Apache error log file or displayed on a PHP web page:

Parse Error: syntax error, unexpected $end in ….. scripts.php on line …

If you are running PHP 5 then that means you probably need to enable the PHP configuration file option “short_open_tag”. In your php.ini file enable the option as follows:

short_open_tag = On

How to Query Multiple Databases in PHP

You can perform a SQL query against more than one database with PHP. Here is a sample generic SQL query against two databases:

SELECT image.image_title, greetings.date
FROM db1.image, db2.greetings
WHERE greetings.image_id=image.imageid

And here is some PHP sample code on how you would query two databases in a single SQL statement:

$query="INSERT INTO db1.table1 SELECT * FROM db2.table2 WHERE a=1";
mysql_query($query,$connection);

How to Check if an Apache Module Has Been Loaded

Sometimes it is useful in the Apache configuration httpd.conf file to only apply configuration settings if a particular module has already been loaded. Or it is useful to load settings in the event an Apache module has not been loaded. Here is how to handle both cases:

<IfModule module_identifier>
  # do these Apache settings if the module has already been loaded
</IfModule>
<IfModule !module_identifier>
  # do these Apache settings if the module has NOT already been loaded
</IfModule>

Here are some examples:

<IfModule !php5_module>
  # If the PHP5 module has NOT already been loaded, load it
  LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule php5_module>
  # If the PHP5 module has already been loaded, then do these settings
  AddHandler php5-script .php
  AddType text/html .php
  DirectoryIndex index.php
</IfModule>

The module_identifier argument can be either the module identifier or the file name of the module, at the time it was compiled. For example, rewrite_module is the identifier and mod_rewrite.c is the file name. If a module consists of several source files, use the name of the file containing the string STANDARD20_MODULE_STUFF. You can read more about the <IfModule> Apache directive in the Apache documentation.

“Internal Error 2739” When Trying to Install Adobe Photoshop CS3 in Windows Vista

When trying to install Adobe Creative Suite 3 ( CS3 ) you may encounter the following error message:

Internal Error 2739

This error message occurs right after you run the setup program to install CS3. The problem is that a DLL file needs to be reregistered with Vista. To fix this error perform the following steps:

1. Open a command prompt but do so with administrative privileges. See this link on how to do this.

2. If you are running Windows Vista 32-bit, then ensure the command prompt is currently in the directory “C:\Windows\System32\” which should be the default starting location when you open the command prompt. If you are running Vista 64-bit, then run the following command to get to the correct directory:

cd ..\SysWow64

3. Type the following command in the command prompt window and then press ENTER:

regsvr32 jscript.dll
  • If the problem persists, then additionally run the command :
regsvr32 vbscript.dll

4. Try running the CS3 installer again. It should now work.