php_printer.dll & IIS - php

PHP 5.2.5
Microsoft IIS 6.0
Windows Server 2003 R2
I have just enabled php_printer.dll in my php.ini file, and it works correctly from the command line. However, running the same commands within a script running on IIS gives me a "call to undefined function printer_open() ...". My boss says we shouldn't have to restart IIS to get it to work, and is unwilling to try, because of the few mission-critical apps we have running on that server. Is restarting IIS necessary, or should the commands be accessible from a script as well as from the command line?

I suggest you ask on serverfault whether a IIS Process Recycling is advisable to reload php/isapi.

Related

How to properly install Xampp on Mac in order to run PHP code

I downloaded the installer version of Xampp version 8.1.6-0 for Mac and went to the manager-osx widget to start the Apache and MySQL servers but neither would start.
I then tried using the command sudo apachectl start and then created an index.php file and put it in htdocs, and then tried to open it using http://localhost/index.php as well as http://localhost:8080/index.php and both times it said the server could not be reached.
I've actually downloaded Xamp in the past and was able to reach the server but wasn't able to get php scripts to run, but now for some reason I can't even get the server to run.
I made sure to download the installer and not the virtual machine version. I'm running Monterey version 12.4.
I tried the solutions here but they didn't seem to work. I checked my activity monitor and nothing is running on port 80.
I also installed MAMP from here and tried to start Apache but it displayed the error:
"Apache couldn't be started. Please check your MAMP installation and
configuration."
Any help would be appreciated as I just want to run PHP.

Error Module 'xmlrpc' already loaded when both IIS and Wamp are running

I have IIS and WAMP both install and I am in a situation where I would need both to run simultaneously. The problem is if they both run whenever I want to access a php application using IIS I am getting error Module 'xmlrpc' already loaded How can I run the application from IIS while Wamp is running ? I need the data I need is on wamp mysql.
I run wamp server on 81 and IIS on 80 to escape the problem I run IIS before running wamp.

Loading Newly Installed PHP Module Into Apache

I am working to build a small email client inside a web application. After doing some research I attempted to use the imap function. I got an error saying I was calling an undefined function, so again I researched and uncommented extension=php_imap.dll.
I then found I had to update php with the imap function and I did so. Now, the imap functions works in php interactive inside Terminal, but I can't get it to work in the browser. I'm assuming I have to somehow load it in the Apache Config files but I can't seem to find how to do so.
Any Ideas?
You'll need to restart Apache to reload the PHP module with the new configuration. The command line PHP starts a new PHP instance each time with the latest configuration, whereas the PHP extension running in Apache is separate, and only loads new configuration setting when Apache itself is restarted.
Assuming you're running on Windows based on the .dll extension, so apachectl restart or apache2ctl restart may work, or the installer you used may have a tray app or other GUI tool that can do it for you.
If running on Linux sudo service apache2 restart or sudo service httpd restart depending on distribution.

Call to undefined function oci_connect only from cli (works fine in html)

Environment:
Server: Ubuntu Server 12.04 x64
Web Server: Apache 2
PHP: 5.3.10-1ubuntu3.8
Oracle: Instant Client 11.2
Problem:
I have a script that I am setting up as a cron job, but when it runs it produces
PHP Fatal error; Call to undefined function oci_connect() in /var/www/reports/inc/config.php on line 25
If I run this script or any other script using oci_connect or oci_pconnect through Apache, they work fine. I just migrated to a new machine and the script ran fine on the previous machine, but I cannot think of what I am missing.
Permissions on the script are the same as the config file and I have tried running as www-data, my user account, and root (all provide the same error).
You have to specifie the user custom profile file (.bash_profile or .profile) before launching the script
0 7 * * * . $HOME/.bash_profile; php -e -c /etc/php.ini /var/www/html/script_avec_oci.php
When you use PHP from the shell or crontab, you're using the CLI version, not the webserver version, and they usually have separate php.ini files. Edit /etc/php5/cli/php.ini and enable the OCI extension.

PHP.exe (CLI) can't connect to MySQL while Firefox can!

I have installed XAMPP on a Windows XP Machine. PHP scripts are working fine through the browser.
Initially, PHP.exe (CLI) was failing with error - can't load php_pgsql.dll
I disabled extension=php_pgsql.dll in the php.ini file and PHP.exe stopped to fail.
However, even now I am not able to run a PHP script from the CLI even though the same script runs fine through the browser.
The script fails at mysqli_connect() with error - Can't connect to MySQL server on '127.0.0.1'
Has somebody else faced the same problem?
Kshitij
Did you start the MySQL service via the XAMPP Control panel and it kept beeing marked as "Running" in both test cases?
Did you test the webserver version by requesting something like http://localhost/... or http://127.0.0.1/... and did you run the php.exe -f something.php test on the same machine?
How many php.ini have you got? It's likely the CLI version has a different php.ini than the web version.
Is the path to your mysql DLLs in your command session's PATH environment variable? You probably need to add \pathtomysql\bin to your path. On my machine it is:
C:\Program Files\MySQL\MySQL Server 5.0\bin

Categories