-
Notifications
You must be signed in to change notification settings - Fork 2
InstallationGuideDebuggingInVSC
tnier01 edited this page Jul 14, 2021
·
1 revision
This page describes how to debug OJS on macOS and Linux. These are individually created instructions. Additionally, programs for PostgreSQL interfaces are suggested for installation.
An alternative to the approach presented here is offered by psysh, a corresponding video for use with OJS can be found here: video.
- Install the LAMP stack. For more instructions follow this guide.
- Start the apache Server:
sudo service apache2 restart
- Go to http://localhost and check if the Apche Ubuntu Default Page
- Go to /var/www/html/ and make a PHP file named
test.php
with the following content:
<?php
phpinfo();
?>
- Restart the server like in 1. and go to http://localhost/test.php.
- Copy the PHP infos.
- Go to this site and paste the PHP infos into the first text field. Follow the given guide to install Xdebug.
- Restart the apache server and go to http://localhost/test.php and check if there is now a section about Xdebug.
- Go to /etc/php/7.4/cli/conf.d and open the
20-xdebug.ini
in an editor and these lines:
zend_extension=xdebug.so
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
- Install VSC. Follow this guide.
- In VSC go to the extensions section and search for the
PHP Debug
extension. Then install it. - Now go to debug section and choose create a launch.json. Then select PHP. There should now be a
.vscode
folder in your project.
- Start your OJS Server.
- Set a breakpoint in the plugin code within VSC. And set the debug mode to
Listen for Xdebug
. - Reload the corresponding page on the localhost.
- VSC will open again with the debugging info.
- In the Terminal run the command:
sudo apt-get install phppgadmin
- After the installation run:
a2enconf phppgadmin
service apache2 reload
- Go to http://localhost/phppgadmin and interact with your database.
A detailed description can be found here: Installation Guide OJS
- A detailed description can be found here: Installation Guide VSC
- Open your terminal and type in:
pecl install xdebug
- A detailed description can be found here: Installation Xdebug
- Check if Xdebug appears in
phpinfo().php
- open the
php.ini
e.g. byand delete the first linecode /usr/local/etc/php/yourPHPVersion/php.ini
zend_extension="xdebug.so"
- open or create the
ext-xdebug.ini
e.g. byand add the following linescode code /usr/local/etc/php/yourPHPVersion/conf.d/ext-xdebug.ini
[xdebug] zend_extension="xdebug.so" xdebug.mode = debug xdebug.start_with_request = yes xdebug.client_port = 9000
- Install the felixfbecker.php-debug-extension in VSC
- Now go to debug section and choose create a launch.json. Then select PHP.
- Start your OJS Server and your PostgreSQL instance.
- Set a breakpoint in the plugin code within VSC.
- Set the debug mode to Listen for Xdebug.
- Reload the corresponding page on the localhost.
- VSC will open again with the debugging info.
- interesting tool to get an overview about the OJS database
- A installation guide can be found here: postico
- add a favorite in the postico application and insert
Host: localhost
User: yourPostgreSQLUsername
These settings should be enoughDatabase: yourOJSPostgreSQLDatabaseName
- start your database in the terminal
brew services start postgresql
-
Connect
in the postico application