XAMPP in OS X El Capitan - oci_connect(): OCIEnvNlsCreate() failed - php

This issue started just after I upgraded my Mac to OS X El Capitan. Before that it was working just fine.
I am using XAMPP and Oracle Instant Client was properly set up to connect with Oracle DB. I followed the instructions mentioned here while installing (click on the question "How do I activate the OCI8/Oracle extension for PHP?").
But, after I upgraded my OS to OS X El Capitan, it started to show this warning,
Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that DYLD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries
I am searching for solution all over the internet (not only SO), for the last few days and the nearest match I found was this : https://stackoverflow.com/a/20670810/5645769. So, I tried to edit the file org.apache.httpd.plist, as suggessted by the answer. But I was having this error :
You don't own the file "org.apache.httpd.plist" and don't have permission to write to it. You can duplicate this document and edit the duplicate. Only the duplicate will include your changes.
I asked about that to OP and his reply didn't make any help to resolve the issue. So my search for solutions continued. After a few more days of search, I found this post https://stackoverflow.com/a/32910408/5645769. So I followed the instructions to disable SIP (System Intregrity Protection) and I was then able to add write access to the file and containing folder for my account (and also administrator). After that oci_connect() started working again.
But when I disabled the SIP again following the same answer, the same error comes again. I am not sure, but it seems like there is something happening with other file permissions which oci_connect() is trying to use but it can access only when SIP is disabled.
Currently I am working with keeping the SIP disabled (not sure, what harm it may cause), I need a solution which will work while keeping the SIP enabled.
I am spending many days with this. Any help will be highly appreciated.

/System/Library/LaunchDaemons/org.apache.httpd.plist is only for controlling the behaviour of the Apache server built in to OS X.
To set DYLD_LIBRARY_PATH for the XAMPP version of Apache you'll need to edit its startup script:
sudo nano /Applications/XAMPP/xamppfiles/apache2/ctl.sh
On the second line of the file, after #!/bin/sh you can add whatever you need to:
#!/bin/sh
DYLD_LIBRARY_PATH=/path/to/your/library/files
ERROR=0
HTTPD_STATUS=""
HTTPD_PIDFILE=/Applications/XAMPP/xamppfiles/logs/httpd.pid
HTTPD="/Applications/XAMPP/xamppfiles/bin/httpd -f /Applications/XAMPP/xamppfiles/etc/httpd.conf"
DO NOT disable system integrity protection. It's there for a reason.

Related

Why am I getting so many error messages in phpmyadmin localhost?

I just set up XAMPP and, when I start the Apache localhost, it displays all of these errors when I search "localhost/phpmyadmin"
I am very new to this (just downloaded XAMPP) and I watched this tutorial: https://www.youtube.com/watch?v=hqfIksHKPPg on setting it up (I didn't install phpmyadmin since it was already installed with XAMPP)
I edited the notepad text files as stated in the video, but instead of a login, I get all of the error messages shown in the above picture...
I also opened config.inc.php and edited the line:
['Servers'][$i]['(MySQL root password)'] = '';$cfg
so it matched MySQL root password
Even if you have a suggestion to fix one of the errors, please still comment
Also, if you need any more information please let me know
You're getting several error messages because you have several problems :)
Cannot connect: invalid settings
Some setting is incorrect, most likely something in your config.inc.php is misspelled or incorrectly copied and pasted. Specifically, if the line ['Servers'][$i]['(MySQL root password)'] = '';$cfg is actually how it appears in your configuration, that is clearly the problem as the line should actually be $cfg['Servers'][$i]['password'] = 'green'; except with you password instead of 'green'...except that only applies if your auth_type is 'config', otherwise the 'password' line isn't used at all (since you're prompted for the password at log in). I'm not sure what XAMPP does here for auth_type, but I don't think you should have had to edit the configuration file at all, since you used the XAMPP installer which should have configured everything.
The server requested authentication method unknown to the client [sha256_password]
This appears to be a bit of a version mismatch in your installed files. Access denied after setting user's password with SHA256 in phpMyAdmin goes in to more detail, but this most often occurs when you've got MySQL 8 and PHP older than 7.4. Normally, I'd suggest upgrading your PHP version — but you're using the packaged XAMPP, which certainly wouldn't ship with conflicting MySQL and PHP versions, so something is odd here. Please confirm for us your MySQL and PHP versions. You didn't happen to have an existing MySQL or PHP installation before you installed XAMPP, did you?
Connection for controluser as defined in your configuration failed
This is probably related to the MySQL 8/PHP 7.4 conflict. There is an administrative user (called the controluser) that phpMyAdmin can use to manage some extra features, ordinarily you wouldn't need it to access phpMyAdmin (only to access those additional features), but it seems XAMPP has configured this for you. Since the authentication fails, you get an additional message that the controluser was not able to connect.
You could bypass this by commenting out the configuration lines referencing controluser and controlpass, although again the XAMPP package should have this all configured so I don't recommend that at this point.
The other messages are basically echoes of the previous messages; you get an additional protocol notification because the controluser is trying the same sha256 connection type that the main user was, and then finally phpMyAdmin is telling you that MySQL rejected the connection.
If this is a fresh XAMPP install, I'd suggest reinstalling, because something got a bit confused. I'd also suggest making sure that you don't have any other conflicting software running — XAMPP is a package of all the included parts, so you don't want to install or run your own Apache or MySQL instance which would interfere with the packaged kit.

my wamp 3.0.6 is not starting giving apache error.Can someone pleaserecommend?

I want to install latest PHP 7 version so I was installing it in my vista homepremium 32 bit. But it is giving Apache error. My Apache is not working. Can someone please help or recommend me another version for PHP 7 so as I can install Laravel.
If you have an issue in the httpd.conf or any files included by it there are a couple of ways to find out what the problem is
First look at your Windows Event Viewer. Click on the Windows link in the left and menu and then Applications. Look for messages from Apache with the red error icon.
Secondly, open a command window, then CD into \wamp\bin\apache\apache2.x.y\bin, replace x,y with your actual version. Now you can run this command to get Apache(httpd) to vaidate the httpd.conf file.
httpd.exe -t
This should give errors with line numbers related to the http.conf file. It stops on the first error, so you will have to keep running it and fixing the error and then run it again until it gives the all OK message.
Original answer: RiggsFolly

Apache in MAMP Pro 4 has stopped working, refuses to start

Have been using MAMP Pro for a fair while - version 3 primarily, upgraded to 4 a while ago.
I haven't had any unusual issues at all, but today the Apache service failed to start, telling me to check the error logs. The logs were blank unfortunately... I've made no system configuration changes, no changes to MAMP/MAMP Pro. Shut down my system yesterday, started today, it no longer works...
I've tried numerous suggestions found via Stack Overflow and Google without any success.
Even after completely uninstalling and re-installing MAMP Pro I am unable to get the service to start.
Nothing appears in the logs...
When starting it manually on the command line it comes up with a PHP related error:
$ Applications/MAMP/bin/apache2/bin/apachectl start
httpd: Syntax error on line 135 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so into server: dlopen(/Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, 10): image not found
The confusing thing is that I don't have PHP 5.2.17 specified anywhere, at all - according to MAMP Pro it should be using PHP 7.0.12.
If I add PHP 5.2.17 to MAMP using the appropriate MAMP Pro dialogs, Apache still fails to start via the MAMP Pro interface. I can now start it manually from the command line however, but none of my virtual hosts/etc seem to be loaded.
apachectl -V tells me it's using /Applications/MAMP/conf/apache/httpd.conf, but there is nothing in that file that has any reference to any of the configs generated in /Library/Application Support/appsolute/MAMP PRO/conf
It also looks like hosts entries aren't added to /etc/hosts.
Even if I tell /Applications/MAMP/conf/apache/httpd.conf to do nothing but include /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf (and manually add entries to /etc/hosts) it still doesn't seem to work at all...
I and my colleagues are at a complete loss, especially given it was working yesterday...
Has anyone had any issues like this?
I managed to fix the similar issue you had.
My Apache server was working fine and then following updating to 4.0.6 I experienced similar issues.
There were 2 things I did to fix the issue. I was getting the same error where it couldn't find a php file in 5.2.17. After fixing that by adding 5.2.17 to MAMP I experienced an apache error regarding user permissions.
(22)Invalid argument: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
File > Edit Template > Revert ALL Templates to Default Settings.
Save & restarted the servers and all worked finally and all my hosts had retained as well.
I had previously entered a custom line in my httpd.conf file that for countless versions had copied across fine however it looks like the folder structure had changed and so couldn't locate it causing the unusual error about User permissions. I have since re-entered the custom line with the correct structure and all working fine again.
Hope this helps.

Cannot Start Wamp Server

For some unknown reason I cannot start WAMP server - The icon stays yellow no matter what:
Checked port 80, and it's not used.
No Skype, no Firewall.
Tried MANY solutions I suggested here in stackoverflow - absolutely nothing.
Tried to uninstall and reinstall - it worked for 10 minutes, then it didn't work again.
The only thing I'm changing is to include Virtual Hosts under httpd.conf. Checked every solution I could find on the net - nothing is working for me.
Maybe, just maybe it's because I previously installed PHP 5.5 apart from WAMP? If I go to PHP > PHP Extensions > then I can see there's a problem in php_opcache and php_enchant. When I click on them I get an error message that says: Could not execute menu item (internal error). [Execption] Could not perform service action: the service has not been started. The PHP Version I installed is 5.5.15. The PHP WAMP is 5.5.12... I don't have a clue how to uninstall PHP, and I couldn't find anything about that on the net.
PHP Error log says: PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - %1 is not a valid Win32 application. in Unknown on line 0
EDIT - It seems like the cause for the problem is me trying to include Virtual Host via httpd.conf file. When I excluded, like in default, WAMP is online again. Any suggestion of how to include virtual host and still get WAMP get online?
It looks like you're running on a corrupt install have you tried reinstalling the software?
Alternatively i would recommend using Xampp which basically offers the same service as Wampp only with a bit more ease of access (also allowing for Mecury mail service and an FTP server for remote access).
The problem with php_intl can be corrected easily, see this answer
In order to find out what Apache is complaining about with the Virtual Hosts definition look at the Windows Event Log or, launch a command window and
cd \wamp\bin\apache\apachex.y.z\bin
httpd -t
This should give you filename and line number where your errors are.
Try changing that port number anyway. Mine stays yellow if the port number is set to 80, even though WAMP says it's not being used by any other program.

Can't get XDebug to make a connection in Vim. Getting "no attribue 'stop'" error

Judging by how many search engine hits this error message generates, I know this is a common problem, yet there aren't any helpful answers out there.
I'm trying to setup XDebug in Vim using Sam Ghods Debugger.vim script while following the instructions on How to Debug PHP with Vim and XDebug on Linux (which is a commonly referenced source on getting Vim setup with XDebug). I'm running MacVim 7.3 on OSX 10.6 and when I try to connect the debugger to the server, I get:
(<type 'exceptions.AttributeError'>, AttributeError("DbgProtocol instance has no attribute 'stop'",), <traceback object at 0x104595680>)
File "/Users/tjlahr/.vim/plugin/debugger.py", line 1078, in debugger_run
debugger.run()
File "/Users/tjlahr/.vim/plugin/debugger.py", line 928, in run
self.protocol.accept()
File "/Users/tjlahr/.vim/plugin/debugger.py", line 560, in accept
self.stop()
Does anybody have experience troubleshooting this error?
Please note that I'm not debugging over port 9000 because it seems it might conflict with fastcgi enabled in PHP. So I'm debugging over port 9001 and have changed by settings in php.ini and the g:debuggerPort variable respectively.
Thanks for your help.
I think I got it!
Can you try installing this Vim Plugin:
http://www.vim.org/scripts/script.php?script_id=2508
It seems that "AttributeError("DbgProtocol instance has no attribute 'stop'",)" is a general error.
I just installed XDebug and the debugger.vim plugin and ended up receiving this message. My problem was that remote debugging was not enabled. Build a phpinfo file:
<?php
phpinfo();
?>
somewhere in your web server directory, and check over all your xdebug configuration variables, which should be listed near the bottom of the page. On my system with xdebug-v2.2.0-dev built from the GitHub repo, xdebug.remote_enable was set to false. Pasting that at the bottom of your php.ini file and setting it's value to 1 enabled clients to connect to the xdebug session.
Also, in the xdebug source there is a directory called "debugclient", which can be used to test any connection problems. Follow the instructions in the INSTALL file in it's directory to build it.
And, one last thought, after you run the plugin script in VIM, you need to refresh the webpage you are trying to debug within 5 seconds, or else the script, acting as a client, will timeout.

Categories